xref: /llvm-project/llvm/test/CodeGen/DirectX/Metadata/lib-entries.ll (revision 3734fa8c724ce2af2f69886ca97c05c6c3717c34)
1; RUN: opt -S  -S -dxil-translate-metadata %s 2>&1 | FileCheck %s
2target triple = "dxil-pc-shadermodel6.8-library"
3
4
5; CHECK: !dx.shaderModel = !{![[SM:[0-9]+]]}
6; CHECK: !dx.version = !{![[DXVER:[0-9]+]]}
7; CHECK: !dx.entryPoints = !{![[LIB:[0-9]+]], ![[AS:[0-9]+]], ![[MS:[0-9]+]], ![[CS:[0-9]+]]}
8
9; CHECK: ![[SM]] = !{!"lib", i32 6, i32 8}
10; CHECK: ![[DXVER]] = !{i32 1, i32 8}
11; CHECK: ![[LIB]] = !{null, !"", null, null, null}
12; CHECK: ![[AS]] = !{ptr @entry_as, !"entry_as", null, null, ![[AS_SF:[0-9]*]]}
13; CHECK: ![[AS_SF]] =  !{i32 8, i32 14}
14; CHECK: ![[MS]] = !{ptr @entry_ms, !"entry_ms", null, null, ![[MS_SF:[0-9]*]]}
15; CHECK: ![[MS_SF]] =  !{i32 8, i32 13}
16; CHECK: ![[CS]] = !{ptr @entry_cs, !"entry_cs", null, null, ![[CS_SF:[0-9]*]]}
17; CHECK: ![[CS_SF]] =  !{i32 8, i32 5, i32 4, ![[CS_NT:[0-9]*]]}
18; CHECK: !{i32 1, i32 2, i32 1}
19
20define void @entry_as() #0 {
21entry:
22  ret void
23}
24
25define i32 @entry_ms(i32 %a) #1 {
26entry:
27  ret i32 %a
28}
29
30define float @entry_cs(float %f) #3 {
31entry:
32  ret float %f
33}
34
35attributes #0 = { noinline nounwind "hlsl.shader"="amplification" }
36attributes #1 = { noinline nounwind "hlsl.shader"="mesh" }
37attributes #3 = { noinline nounwind "hlsl.numthreads"="1,2,1" "hlsl.shader"="compute" }
38