blob: 1eaa1436e5d31104320d1b1d3ff130d66fe3ac07 [file] [log] [blame]
dan sinclair69313792024-06-13 20:35:21 +00001
dan sinclair8f1d2762024-07-31 02:35:40 +00002void deref_const() {
Antonio Maioranod032c622024-09-19 18:20:54 +00003 int3 a = (int(0)).xxx;
Antonio Maiorano4fc7d412024-10-01 21:50:36 +00004 int b = a.x;
5 a[int(0)] = int(42);
dan sinclair8f1d2762024-07-31 02:35:40 +00006}
7
8void no_deref_const() {
Antonio Maioranod032c622024-09-19 18:20:54 +00009 int3 a = (int(0)).xxx;
Antonio Maiorano4fc7d412024-10-01 21:50:36 +000010 int b = a.x;
11 a[int(0)] = int(42);
dan sinclair8f1d2762024-07-31 02:35:40 +000012}
13
14void deref_let() {
Antonio Maioranod032c622024-09-19 18:20:54 +000015 int3 a = (int(0)).xxx;
Antonio Maioranod032c622024-09-19 18:20:54 +000016 int i = int(0);
Antonio Maiorano4fc7d412024-10-01 21:50:36 +000017 int b = a[i];
18 a[int(0)] = int(42);
dan sinclair8f1d2762024-07-31 02:35:40 +000019}
20
21void no_deref_let() {
Antonio Maioranod032c622024-09-19 18:20:54 +000022 int3 a = (int(0)).xxx;
Antonio Maioranod032c622024-09-19 18:20:54 +000023 int i = int(0);
Antonio Maiorano4fc7d412024-10-01 21:50:36 +000024 int b = a[i];
25 a[int(0)] = int(42);
dan sinclair8f1d2762024-07-31 02:35:40 +000026}
27
28void deref_var() {
Antonio Maioranod032c622024-09-19 18:20:54 +000029 int3 a = (int(0)).xxx;
Antonio Maioranod032c622024-09-19 18:20:54 +000030 int i = int(0);
Antonio Maiorano4fc7d412024-10-01 21:50:36 +000031 int b = a[i];
32 a[int(0)] = int(42);
dan sinclair8f1d2762024-07-31 02:35:40 +000033}
34
35void no_deref_var() {
Antonio Maioranod032c622024-09-19 18:20:54 +000036 int3 a = (int(0)).xxx;
Antonio Maioranod032c622024-09-19 18:20:54 +000037 int i = int(0);
Antonio Maiorano4fc7d412024-10-01 21:50:36 +000038 int b = a[i];
39 a[int(0)] = int(42);
dan sinclair8f1d2762024-07-31 02:35:40 +000040}
41
42[numthreads(1, 1, 1)]
43void main() {
44 deref_const();
45 no_deref_const();
46 deref_let();
47 no_deref_let();
48 deref_var();
49 no_deref_var();
50}
51