blob: 28f45ae9a5f6575af44510f06b78b1a05b781b4b [file] [log] [blame]
fn deref_const() {
var a : vec3<i32>;
let p = &(a);
var b = (*(p))[0];
(*(p))[0] = 42;
}
fn no_deref_const() {
var a : vec3<i32>;
let p = &(a);
var b = p[0];
p[0] = 42;
}
fn deref_let() {
var a : vec3<i32>;
let p = &(a);
let i = 0;
var b = (*(p))[i];
(*(p))[0] = 42;
}
fn no_deref_let() {
var a : vec3<i32>;
let p = &(a);
let i = 0;
var b = p[i];
p[0] = 42;
}
fn deref_var() {
var a : vec3<i32>;
let p = &(a);
var i = 0;
var b = (*(p))[i];
(*(p))[0] = 42;
}
fn no_deref_var() {
var a : vec3<i32>;
let p = &(a);
let i = 0;
var b = p[i];
p[0] = 42;
}
@compute @workgroup_size(1)
fn main() {
deref_const();
no_deref_const();
deref_let();
no_deref_let();
deref_var();
no_deref_var();
}