blob: 72fa55ce653f0bc342af7898a6236d834c7f5cdd [file] [log] [blame]
Antonio Maiorano08d92792024-01-11 20:51:50 +00001void deref_const() {
2 int3 a = int3(0, 0, 0);
3 int b = a[0];
4 a[0] = 42;
5}
6
7void no_deref_const() {
8 int3 a = int3(0, 0, 0);
9 int b = a[0];
10 a[0] = 42;
11}
12
13void deref_let() {
14 int3 a = int3(0, 0, 0);
Antonio Maiorano144ebed2024-01-30 16:30:15 +000015 int i = 0;
Antonio Maiorano08d92792024-01-11 20:51:50 +000016 int b = a[i];
17 a[0] = 42;
18}
19
20void no_deref_let() {
21 int3 a = int3(0, 0, 0);
Antonio Maiorano144ebed2024-01-30 16:30:15 +000022 int i = 0;
Antonio Maiorano08d92792024-01-11 20:51:50 +000023 int b = a[i];
24 a[0] = 42;
25}
26
27void deref_var() {
28 int3 a = int3(0, 0, 0);
29 int i = 0;
30 int b = a[i];
31 a[0] = 42;
32}
33
34void no_deref_var() {
35 int3 a = int3(0, 0, 0);
Antonio Maiorano144ebed2024-01-30 16:30:15 +000036 int i = 0;
Antonio Maiorano08d92792024-01-11 20:51:50 +000037 int b = a[i];
38 a[0] = 42;
39}
40
41[numthreads(1, 1, 1)]
42void main() {
43 deref_const();
44 no_deref_const();
45 deref_let();
46 no_deref_let();
47 deref_var();
48 no_deref_var();
49 return;
50}