Skip to content

Commit 8fb20f0

Browse files
committed
Add a test to verify correct metadata creation for multiple
shader entries during library profile compilation.
1 parent 4386eeb commit 8fb20f0

File tree

1 file changed

+39
-0
lines changed

1 file changed

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

0 commit comments

Comments
 (0)