|
1 |
| -// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -emit-llvm -disable-llvm-passes %s -o - | FileCheck %s --check-prefixes=CS,NOINLINE,CHECK |
2 |
| -// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -emit-llvm -disable-llvm-passes %s -o - | FileCheck %s --check-prefixes=LIB,NOINLINE,CHECK |
| 1 | +// RUN: %clang_cc1 -triple spirv-unknown-vulkan1.3-compute -emit-llvm -disable-llvm-passes %s -o - | FileCheck %s --check-prefixes=CS,NOINLINE-SPIRV,CHECK |
| 2 | +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -emit-llvm -disable-llvm-passes %s -o - | FileCheck %s --check-prefixes=CS,NOINLINE-DXIL,CHECK |
| 3 | +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -emit-llvm -disable-llvm-passes %s -o - | FileCheck %s --check-prefixes=LIB,NOINLINE-DXIL,CHECK |
3 | 4 | // RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -emit-llvm -O0 %s -o - | FileCheck %s --check-prefixes=INLINE,CHECK
|
4 | 5 | // RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -emit-llvm -O0 %s -o - | FileCheck %s --check-prefixes=INLINE,CHECK
|
5 | 6 |
|
@@ -57,22 +58,37 @@ void main(unsigned GI : SV_GroupIndex) {
|
57 | 58 | // CHECK: define void @main()
|
58 | 59 | // CHECK-NEXT: entry:
|
59 | 60 | // Verify destructor is emitted
|
60 |
| -// NOINLINE-NEXT: call void @_GLOBAL__sub_I_GlobalDestructors.hlsl() |
61 |
| -// NOINLINE-NEXT: %0 = call i32 @llvm.dx.flattened.thread.id.in.group() |
62 |
| -// NOINLINE-NEXT: call void @_Z4mainj(i32 %0) |
63 |
| -// NOINLINE-NEXT: call void @_GLOBAL__D_a() |
64 |
| -// NOINLINE-NEXT: ret void |
| 61 | +// NOINLINE-DXIL-NEXT: call void @_GLOBAL__sub_I_GlobalDestructors.hlsl() |
| 62 | +// NOINLINE-DXIL-NEXT: %0 = call i32 @llvm.dx.flattened.thread.id.in.group() |
| 63 | +// NOINLINE-DXIL-NEXT: call void @_Z4mainj(i32 %0) |
| 64 | +// NOINLINE-DXIL-NEXT: call void @_GLOBAL__D_a() |
| 65 | +// NOINLINE-DXIL-NEXT: ret void |
| 66 | + |
| 67 | +// NOINLINE-SPIRV-NEXT: %0 = call token @llvm.experimental.convergence.entry() |
| 68 | +// NOINLINE-SPIRV-NEXT: call spir_func void @_GLOBAL__sub_I_GlobalDestructors.hlsl() [ "convergencectrl"(token %0) ] |
| 69 | +// NOINLINE-SPIRV-NEXT: %1 = call i32 @llvm.spv.flattened.thread.id.in.group() |
| 70 | +// NOINLINE-SPIRV-NEXT: call spir_func void @_Z4mainj(i32 %1) [ "convergencectrl"(token %0) ] |
| 71 | +// NOINLINE-SPIRV-NEXT: call spir_func void @_GLOBAL__D_a() [ "convergencectrl"(token %0) ] |
| 72 | +// NOINLINE-SPIRV-NEXT: ret void |
| 73 | + |
65 | 74 | // Verify inlining leaves only calls to "llvm." intrinsics
|
66 | 75 | // INLINE-NOT: call {{[^@]*}} @{{[^l][^l][^v][^m][^\.]}}
|
67 | 76 | // INLINE: ret void
|
68 | 77 |
|
69 | 78 | // This is really just a sanity check I needed for myself to verify that
|
70 | 79 | // function scope static variables also get destroyed properly.
|
71 | 80 |
|
72 |
| -// NOINLINE: define internal void @_GLOBAL__D_a() [[IntAttr:\#[0-9]+]] |
73 |
| -// NOINLINE-NEXT: entry: |
74 |
| -// NOINLINE-NEXT: call void @_ZN4TailD1Ev(ptr @_ZZ3WagvE1T) |
75 |
| -// NOINLINE-NEXT: call void @_ZN6PupperD1Ev(ptr @GlobalPup) |
76 |
| -// NOINLINE-NEXT: ret void |
| 81 | +// NOINLINE-DXIL: define internal void @_GLOBAL__D_a() [[IntAttr:\#[0-9]+]] |
| 82 | +// NOINLINE-DXIL-NEXT: entry: |
| 83 | +// NOINLINE-DXIL-NEXT: call void @_ZN4TailD1Ev(ptr @_ZZ3WagvE1T) |
| 84 | +// NOINLINE-DXIL-NEXT: call void @_ZN6PupperD1Ev(ptr @GlobalPup) |
| 85 | +// NOINLINE-DXIL-NEXT: ret void |
| 86 | + |
| 87 | +// NOINLINE-SPIRV: define internal spir_func void @_GLOBAL__D_a() [[IntAttr:\#[0-9]+]] |
| 88 | +// NOINLINE-SPIRV-NEXT: entry: |
| 89 | +// NOINLINE-SPIRV-NEXT: %0 = call token @llvm.experimental.convergence.entry() |
| 90 | +// NOINLINE-SPIRV-NEXT: call spir_func void @_ZN4TailD1Ev(ptr @_ZZ3WagvE1T) [ "convergencectrl"(token %0) ] |
| 91 | +// NOINLINE-SPIRV-NEXT: call spir_func void @_ZN6PupperD1Ev(ptr @GlobalPup) [ "convergencectrl"(token %0) ] |
| 92 | +// NOINLINE-SPIRV-NEXT: ret void |
77 | 93 |
|
78 | 94 | // NOINLINE: attributes [[IntAttr]] = {{.*}} alwaysinline
|
0 commit comments