diff options
| author | Yong He <yonghe@outlook.com> | 2024-12-10 03:47:16 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-10 19:47:16 +0800 |
| commit | 945d8dd3c4cea58f3d9f36e8fa123137f64e180e (patch) | |
| tree | 686af1024736a5e553c57fc49f4310b0f501571c /tests/language-feature/modules/typealias | |
| parent | ebfbe5886f273e0492321c5ff0c9c2671583a648 (diff) | |
Fix parsing logic of for loops' initial statement. (#5813)
Diffstat (limited to 'tests/language-feature/modules/typealias')
| -rw-r--r-- | tests/language-feature/modules/typealias/lib.slang | 3 | ||||
| -rw-r--r-- | tests/language-feature/modules/typealias/main.slang | 24 |
2 files changed, 27 insertions, 0 deletions
diff --git a/tests/language-feature/modules/typealias/lib.slang b/tests/language-feature/modules/typealias/lib.slang new file mode 100644 index 000000000..72a31ef09 --- /dev/null +++ b/tests/language-feature/modules/typealias/lib.slang @@ -0,0 +1,3 @@ +//TEST_IGNORE_FILE: + +typealias i32 = int32_t; diff --git a/tests/language-feature/modules/typealias/main.slang b/tests/language-feature/modules/typealias/main.slang new file mode 100644 index 000000000..965aec642 --- /dev/null +++ b/tests/language-feature/modules/typealias/main.slang @@ -0,0 +1,24 @@ +//TEST:COMPARE_COMPUTE(filecheck-buffer=CHECK): -output-using-type + +// Regression test for bug https://github.com/shader-slang/slang/issues/5808 + +// Using a type defined from a different module +// in a for loop should work. + +import lib; + +//TEST_INPUT:set output = out ubuffer(data=[0 0 0 0], stride=4) +RWStructuredBuffer<i32> output; + +[numthreads(1,1,1)] +void computeMain() +{ + // CHECK: 0 + // CHECK: 1 + // CHECK: 2 + // CHECK: 3 + for (i32 i = 0; i < 4; i++) + { + output[i] = i; + } +}
\ No newline at end of file |
