diff options
| author | Julius Ikkala <julius.ikkala@gmail.com> | 2025-07-04 00:09:09 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-03 21:09:09 +0000 |
| commit | 551d0c365571a2e36505851f6a713464662c5fea (patch) | |
| tree | e2c95e6b1016d9e129ac3b463b8a003573284f15 /tests | |
| parent | ebfb8d0428b12d3a6cd6de8ebeb13297004cfbe8 (diff) | |
Replace SLANG_ALIGN_OF with C++11 alignof (#7523)
* Replace SLANG_ALIGN_OF with C++11 alignof
* Fix formatting (again)
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/bugs/gh-7522.slang | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/bugs/gh-7522.slang b/tests/bugs/gh-7522.slang new file mode 100644 index 000000000..01464cdac --- /dev/null +++ b/tests/bugs/gh-7522.slang @@ -0,0 +1,15 @@ +//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK): -cpu + +//TEST_INPUT:ubuffer(data=[0 0], stride=4):out,name=outputBuffer +RWStructuredBuffer<int> outputBuffer; + +[numthreads(1, 1, 1)] +void computeMain(int3 dispatchThreadID: SV_DispatchThreadID) +{ + // The point of this test is to just check that __alignOf isn't implemented + // as a C macro that misinterprets templates as multiple arguments and fails + // to compile :) That's why it doesn't care much about the actual values of + // the alignments. + outputBuffer[0] = __alignOf<float2>() > 0 ? 1 : 0; // CHECK: 1 + outputBuffer[1] = __alignOf<vector<int, 2>>() > 0 ? 1 : 0; // CHECK-NEXT: 1 +} |
