diff options
Diffstat (limited to 'tests/spirv')
| -rw-r--r-- | tests/spirv/debug-type-pointer-2.slang | 24 | ||||
| -rw-r--r-- | tests/spirv/debug-type-pointer.slang | 2 |
2 files changed, 25 insertions, 1 deletions
diff --git a/tests/spirv/debug-type-pointer-2.slang b/tests/spirv/debug-type-pointer-2.slang new file mode 100644 index 000000000..4112d4905 --- /dev/null +++ b/tests/spirv/debug-type-pointer-2.slang @@ -0,0 +1,24 @@ +//TEST:SIMPLE(filecheck=CHECK): -target spirv + +// Check that we do not emit forward reference for debug pointer types if there isn't a need to do so. + +// CHECK-NOT: OpExtension "SPV_KHR_relaxed_extended_instruction" +struct T +{ + uint inner; +} + +struct Problem +{ + int getVal() { return some_bda_ptr->inner;} + T *some_bda_ptr; +} + +uniform Problem probs; + +RWStructuredBuffer<float4> outputBuffer; +[shader("compute")] +float4 main() +{ + outputBuffer[0] = float(probs.getVal()); +}
\ No newline at end of file diff --git a/tests/spirv/debug-type-pointer.slang b/tests/spirv/debug-type-pointer.slang index fd3248c59..f6add1735 100644 --- a/tests/spirv/debug-type-pointer.slang +++ b/tests/spirv/debug-type-pointer.slang @@ -9,7 +9,7 @@ RWStructuredBuffer<float> outputBuffer; //SPV:OpExtension "SPV_KHR_relaxed_extended_instruction" //SPV: [[STRING_float:%[1-9][0-9]*]] = OpString "float" //SPV: [[STRING_pValue:%[1-9][0-9]*]] = OpString "pValue" -//SPV: [[STRING_LinkedNode:%[1-9][0-9]*]] = OpString "LinkedNode" +//SPV: [[STRING_LinkedNode:%[1-9][0-9]*]] = OpString "LinkedNode{{.*}}" //SPV: [[STRING_pNext:%[1-9][0-9]*]] = OpString "pNext" struct LinkedNode |
