blob: 52fa6c6efbd0fc392fc007eaf6194f0ced7f6459 [file]
#include <metal_stdlib>
using namespace metal;
struct S {
int x;
};
void deref() {
S a = {};
thread S* const p = (&a);
int b = (*p).x;
(*p).x = 42;
}
void no_deref() {
S a = {};
thread S* const p = (&a);
int b = (*p).x;
(*p).x = 42;
}
[[max_total_threads_per_threadgroup(1)]]
kernel void v() {
(deref());
(no_deref());
}