blob: ed5097ade5b11f9bb13dcd82b6a18a0d4e686622 [file] [log] [blame]
Antonio Maiorano08d92792024-01-11 20:51:50 +00001void deref_const() {
2 int a[10] = (int[10])0;
3 int b = a[0];
4 a[0] = 42;
5}
6
7void no_deref_const() {
8 int a[10] = (int[10])0;
9 int b = a[0];
10 a[0] = 42;
11}
12
13void deref_let() {
14 int a[10] = (int[10])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 int a[10] = (int[10])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 int a[10] = (int[10])0;
29 int i = 0;
30 int b = a[i];
31 a[0] = 42;
32}
33
34void no_deref_var() {
35 int a[10] = (int[10])0;
36 int i = 0;
37 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}