diff options
Diffstat (limited to 'tests/library')
| -rw-r--r-- | tests/library/ambiguous-extern-export-entry.slang | 32 | ||||
| -rw-r--r-- | tests/library/ambiguous-extern-export-lib1.slang | 13 | ||||
| -rw-r--r-- | tests/library/ambiguous-extern-export-lib2.slang | 15 |
3 files changed, 60 insertions, 0 deletions
diff --git a/tests/library/ambiguous-extern-export-entry.slang b/tests/library/ambiguous-extern-export-entry.slang new file mode 100644 index 000000000..afa0ed8c9 --- /dev/null +++ b/tests/library/ambiguous-extern-export-entry.slang @@ -0,0 +1,32 @@ +//TEST(compute):COMPARE_COMPUTE_EX(filecheck-buffer=BUFFER):-slang -compute -shaderobj +//TEST(compute):COMPARE_COMPUTE_EX(filecheck-buffer=BUFFER):-slang -compute -dx12 -shaderobj +//TEST(compute, vulkan):COMPARE_COMPUTE_EX(filecheck-buffer=BUFFER):-vk -compute -shaderobj +//TEST(compute):COMPARE_COMPUTE_EX(filecheck-buffer=BUFFER):-cpu -compute -shaderobj + +import "ambiguous-extern-export-lib1.slang"; +import "ambiguous-extern-export-lib2.slang"; + +export static const int call_data_len = 6; +export static const int call_group_vector[call_data_len] = {1,2,3,4,5,6}; + +//TEST_INPUT:ubuffer(data=[0 0 0 0 0 0], stride=4):out,name=outputBuffer +RWStructuredBuffer<int> outputBuffer; + +[shader("compute")] +[numthreads(1, 1, 1)] +void computeMain() +{ + initCallId1(); + initCallId2(); + + for (int i = 0; i < call_data_len; i++) + { + outputBuffer[i] = call_id_1[i] + call_id_2[i]; + } + // BUFFER: 2 + // BUFFER-NEXT: 4 + // BUFFER-NEXT: 6 + // BUFFER-NEXT: 8 + // BUFFER-NEXT: A + // BUFFER-NEXT: C +} diff --git a/tests/library/ambiguous-extern-export-lib1.slang b/tests/library/ambiguous-extern-export-lib1.slang new file mode 100644 index 000000000..17dc0734c --- /dev/null +++ b/tests/library/ambiguous-extern-export-lib1.slang @@ -0,0 +1,13 @@ +module "ambiguous-extern-export-lib1.slang"; + +public extern static const int call_data_len; +public extern static const int[call_data_len] call_group_vector; +public static int[call_data_len] call_id_1 = {}; + +public void initCallId1() +{ + for (int i = 0; i < call_data_len; i++) + { + call_id_1[i] = call_group_vector[i]; + } +} diff --git a/tests/library/ambiguous-extern-export-lib2.slang b/tests/library/ambiguous-extern-export-lib2.slang new file mode 100644 index 000000000..08d01fb04 --- /dev/null +++ b/tests/library/ambiguous-extern-export-lib2.slang @@ -0,0 +1,15 @@ + +module "ambiguous-extern-export-lib2.slang"; + +public extern static const int call_data_len; +public extern static const int[call_data_len] call_group_vector; + +public static int[call_data_len] call_id_2 = {}; + +public void initCallId2() +{ + for (int i = 0; i < call_data_len; i++) + { + call_id_2[i] = call_group_vector[i]; + } +} |
