Skip to content

Commit 557759b

Browse files
authored
Fixed the new test depending on the order of functions in the module (microsoft#6304)
Rewrote the test so that the test does not depend on the order that the functions appear in the module.
1 parent a8c4450 commit 557759b

File tree

1 file changed

+28
-22
lines changed

1 file changed

+28
-22
lines changed

tools/clang/test/CodeGenDXIL/hlsl/objects/NodeObjects/node-object-export-link-1.hlsl

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,48 @@
11
// RUN: %dxc -T lib_6_x %S/node-object-export-1.hlsl -Fo %t.1
22
// RUN: %dxc -T lib_6_x %s -Fo %t.2
3-
// RUN: %dxc -T lib_6_x -link "%t.1;%t.2" | FileCheck %s
3+
// RUN: %dxc -T lib_6_x -link "%t.1;%t.2" -Fc %t.ll
4+
// RUN: FileCheck %s --input-file %t.ll --check-prefix=FOO2
5+
// RUN: FileCheck %s --input-file %t.ll --check-prefix=BAR
6+
// RUN: FileCheck %s --input-file %t.ll --check-prefix=BAR2
7+
// RUN: FileCheck %s --input-file %t.ll --check-prefix=BAR3
8+
// RUN: FileCheck %s --input-file %t.ll --check-prefix=BAR4
9+
// RUN: FileCheck %s --input-file %t.ll --check-prefix=FOO
410

511
// Confirm that linking a shader calling external functions that take node objects as parameters
612
// correctly includes the external and internal functions
713

814
// Confirm that external function "foo2" is correctly included here even though it is called only by external functions
9-
// CHECK: define void @"\01?foo2@@YA?AU?$DispatchNodeInputRecord@URECORD@@@@U1@@Z"(%"struct.DispatchNodeInputRecord<RECORD>"* noalias nocapture sret, %"struct.DispatchNodeInputRecord<RECORD>"* nocapture readonly) #0 {
10-
// CHECK: %[[Ld:.+]] = load %"struct.DispatchNodeInputRecord<RECORD>", %"struct.DispatchNodeInputRecord<RECORD>"* %{{.+}}, align 4
11-
// CHECK: store %"struct.DispatchNodeInputRecord<RECORD>" %[[Ld]], %"struct.DispatchNodeInputRecord<RECORD>"* %{{.+}}, align 4
15+
// FOO2: define void @"\01?foo2@@YA?AU?$DispatchNodeInputRecord@URECORD@@@@U1@@Z"(%"struct.DispatchNodeInputRecord<RECORD>"* noalias nocapture sret, %"struct.DispatchNodeInputRecord<RECORD>"* nocapture readonly) #{{[0-9]+}} {
16+
// FOO2-NEXT: %[[Ld:.+]] = load %"struct.DispatchNodeInputRecord<RECORD>", %"struct.DispatchNodeInputRecord<RECORD>"* %{{.+}}, align 4
17+
// FOO2-NEXT: store %"struct.DispatchNodeInputRecord<RECORD>" %[[Ld]], %"struct.DispatchNodeInputRecord<RECORD>"* %{{.+}}, align 4
1218

1319
// Confirm that external function "bar" is correctly included here since it is called by bar3
14-
// CHECK: define void @"\01?bar@@YAXU?$DispatchNodeInputRecord@URECORD@@@@U1@@Z"(%"struct.DispatchNodeInputRecord<RECORD>"* nocapture readonly, %"struct.DispatchNodeInputRecord<RECORD>"* noalias nocapture) #0 {
15-
// CHECK: %[[Alloca:.+]] = alloca %"struct.DispatchNodeInputRecord<RECORD>", align 8
16-
// CHECK: call void @"\01?foo@@YA?AU?$DispatchNodeInputRecord@URECORD@@@@U1@@Z"(%"struct.DispatchNodeInputRecord<RECORD>"* nonnull sret %[[Alloca]], %"struct.DispatchNodeInputRecord<RECORD>"* %{{.+}})
17-
// CHECK: %[[Ld:.+]] = load %"struct.DispatchNodeInputRecord<RECORD>", %"struct.DispatchNodeInputRecord<RECORD>"* %[[Alloca]], align 8
18-
// CHECK: store %"struct.DispatchNodeInputRecord<RECORD>" %[[Ld]], %"struct.DispatchNodeInputRecord<RECORD>"* %{{.+}}, align 4
20+
// BAR: define void @"\01?bar@@YAXU?$DispatchNodeInputRecord@URECORD@@@@U1@@Z"(%"struct.DispatchNodeInputRecord<RECORD>"* nocapture readonly, %"struct.DispatchNodeInputRecord<RECORD>"* noalias nocapture) #{{[0-9]+}} {
21+
// BAR-NEXT: %[[Alloca:.+]] = alloca %"struct.DispatchNodeInputRecord<RECORD>", align 8
22+
// BAR-NEXT: call void @"\01?foo@@YA?AU?$DispatchNodeInputRecord@URECORD@@@@U1@@Z"(%"struct.DispatchNodeInputRecord<RECORD>"* nonnull sret %[[Alloca]], %"struct.DispatchNodeInputRecord<RECORD>"* %{{.+}})
23+
// BAR-NEXT: %[[Ld:.+]] = load %"struct.DispatchNodeInputRecord<RECORD>", %"struct.DispatchNodeInputRecord<RECORD>"* %[[Alloca]], align 8
24+
// BAR-NEXT: store %"struct.DispatchNodeInputRecord<RECORD>" %[[Ld]], %"struct.DispatchNodeInputRecord<RECORD>"* %{{.+}}, align 4
1925

2026
// Confirm that external function "bar2" is correctly included here since it is called by bar4
21-
// CHECK: define void @"\01?bar2@@YAXU?$DispatchNodeInputRecord@URECORD@@@@U1@@Z"(%"struct.DispatchNodeInputRecord<RECORD>"* nocapture readonly, %"struct.DispatchNodeInputRecord<RECORD>"* noalias nocapture) #1 {
22-
// CHECK: %[[Ld:.+]] = load %"struct.DispatchNodeInputRecord<RECORD>", %"struct.DispatchNodeInputRecord<RECORD>"* %{{.+}}, align 4
23-
// CHECK: store %"struct.DispatchNodeInputRecord<RECORD>" %[[Ld]], %"struct.DispatchNodeInputRecord<RECORD>"* %{{.+}}, align 4
27+
// BAR2: define void @"\01?bar2@@YAXU?$DispatchNodeInputRecord@URECORD@@@@U1@@Z"(%"struct.DispatchNodeInputRecord<RECORD>"* nocapture readonly, %"struct.DispatchNodeInputRecord<RECORD>"* noalias nocapture) #{{[0-9]+}} {
28+
// BAR2-NEXT: %[[Ld:.+]] = load %"struct.DispatchNodeInputRecord<RECORD>", %"struct.DispatchNodeInputRecord<RECORD>"* %{{.+}}, align 4
29+
// BAR2-NEXT: store %"struct.DispatchNodeInputRecord<RECORD>" %[[Ld]], %"struct.DispatchNodeInputRecord<RECORD>"* %{{.+}}, align 4
2430

2531
// Confirm that internal function "bar3" is correctly included here and calls external function "foo"
26-
// CHECK: define void @"\01?bar3@@YAXU?$DispatchNodeInputRecord@URECORD@@@@U1@@Z"(%"struct.DispatchNodeInputRecord<RECORD>"*, %"struct.DispatchNodeInputRecord<RECORD>"* noalias) #0 {
27-
// CHECK: %[[Alloca:.+]] = alloca %"struct.DispatchNodeInputRecord<RECORD>", align 8
28-
// CHECK: call void @"\01?foo@@YA?AU?$DispatchNodeInputRecord@URECORD@@@@U1@@Z"(%"struct.DispatchNodeInputRecord<RECORD>"* nonnull sret %[[Alloca]], %"struct.DispatchNodeInputRecord<RECORD>"* %{{.+}}) #2
29-
// CHECK: %[[Ld:.+]] = load %"struct.DispatchNodeInputRecord<RECORD>", %"struct.DispatchNodeInputRecord<RECORD>"* %[[Alloca]], align 8
30-
// CHECK: store %"struct.DispatchNodeInputRecord<RECORD>" %[[Ld]], %"struct.DispatchNodeInputRecord<RECORD>"* %{{.+}}, align 4
32+
// BAR3: define void @"\01?bar3@@YAXU?$DispatchNodeInputRecord@URECORD@@@@U1@@Z"(%"struct.DispatchNodeInputRecord<RECORD>"*, %"struct.DispatchNodeInputRecord<RECORD>"* noalias) #{{[0-9]+}} {
33+
// BAR3-NEXT: %[[Alloca:.+]] = alloca %"struct.DispatchNodeInputRecord<RECORD>", align 8
34+
// BAR3-NEXT: call void @"\01?foo@@YA?AU?$DispatchNodeInputRecord@URECORD@@@@U1@@Z"(%"struct.DispatchNodeInputRecord<RECORD>"* nonnull sret %[[Alloca]], %"struct.DispatchNodeInputRecord<RECORD>"* %{{.+}}) #{{[0-9]+}}
35+
// BAR3-NEXT: %[[Ld:.+]] = load %"struct.DispatchNodeInputRecord<RECORD>", %"struct.DispatchNodeInputRecord<RECORD>"* %[[Alloca]], align 8
36+
// BAR3-NEXT: store %"struct.DispatchNodeInputRecord<RECORD>" %[[Ld]], %"struct.DispatchNodeInputRecord<RECORD>"* %{{.+}}, align 4
3137

3238
// Confirm that internal function "bar4" is correctly included here and calls outside function "bar2"
33-
// CHECK: define void @"\01?bar4@@YAXU?$DispatchNodeInputRecord@URECORD@@@@U1@@Z"(%"struct.DispatchNodeInputRecord<RECORD>"*, %"struct.DispatchNodeInputRecord<RECORD>"* noalias) #0 {
34-
// CHECK: call void @"\01?bar2@@YAXU?$DispatchNodeInputRecord@URECORD@@@@U1@@Z"(%"struct.DispatchNodeInputRecord<RECORD>"* %{{.+}}, %"struct.DispatchNodeInputRecord<RECORD>"* %1) #2
39+
// BAR4: define void @"\01?bar4@@YAXU?$DispatchNodeInputRecord@URECORD@@@@U1@@Z"(%"struct.DispatchNodeInputRecord<RECORD>"*, %"struct.DispatchNodeInputRecord<RECORD>"* noalias) #{{[0-9]+}} {
40+
// BAR4-NEXT: call void @"\01?bar2@@YAXU?$DispatchNodeInputRecord@URECORD@@@@U1@@Z"(%"struct.DispatchNodeInputRecord<RECORD>"* %{{.+}}, %"struct.DispatchNodeInputRecord<RECORD>"* %1) #{{[0-9]+}}
3541

3642
// Confirm that external function "foo" is correctly included here even though it is called only by external functions
37-
// CHECK: define void @"\01?foo@@YA?AU?$DispatchNodeInputRecord@URECORD@@@@U1@@Z"(%"struct.DispatchNodeInputRecord<RECORD>"* noalias nocapture sret, %"struct.DispatchNodeInputRecord<RECORD>"* nocapture readonly) #1 {
38-
// CHECK: %[[Ld:.+]] = load %"struct.DispatchNodeInputRecord<RECORD>", %"struct.DispatchNodeInputRecord<RECORD>"* %{{.+}}, align 4
39-
// CHECK: store %"struct.DispatchNodeInputRecord<RECORD>" %[[Ld]], %"struct.DispatchNodeInputRecord<RECORD>"* %{{.+}}, align 4
43+
// FOO: define void @"\01?foo@@YA?AU?$DispatchNodeInputRecord@URECORD@@@@U1@@Z"(%"struct.DispatchNodeInputRecord<RECORD>"* noalias nocapture sret, %"struct.DispatchNodeInputRecord<RECORD>"* nocapture readonly) #{{[0-9]+}} {
44+
// FOO-NEXT: %[[Ld:.+]] = load %"struct.DispatchNodeInputRecord<RECORD>", %"struct.DispatchNodeInputRecord<RECORD>"* %{{.+}}, align 4
45+
// FOO-NEXT: store %"struct.DispatchNodeInputRecord<RECORD>" %[[Ld]], %"struct.DispatchNodeInputRecord<RECORD>"* %{{.+}}, align 4
4046

4147

4248
struct RECORD {

0 commit comments

Comments
 (0)