blob: ae0d826df22953ca2f7969747c31c7f0a6a33afa [file] [log] [blame]
James Pricea30f8dd2024-05-10 14:31:43 +00001#include <metal_stdlib>
2using namespace metal;
3
4void deref() {
5 int3 a = 0;
James Pricede734312024-05-16 22:20:44 +00006 thread int3* const p = (&a);
James Price2d245582024-09-04 16:04:34 +00007 (*p)[0u] = as_type<int>((as_type<uint>((*p)[0u]) + as_type<uint>(42)));
James Pricea30f8dd2024-05-10 14:31:43 +00008}
James Price48be7e82024-06-19 22:38:07 +00009
James Pricea30f8dd2024-05-10 14:31:43 +000010void no_deref() {
11 int3 a = 0;
James Pricede734312024-05-16 22:20:44 +000012 thread int3* const p = (&a);
James Price2d245582024-09-04 16:04:34 +000013 (*p)[0u] = as_type<int>((as_type<uint>((*p)[0u]) + as_type<uint>(42)));
James Pricea30f8dd2024-05-10 14:31:43 +000014}
James Price48be7e82024-06-19 22:38:07 +000015
James Pricea30f8dd2024-05-10 14:31:43 +000016kernel void tint_symbol() {
17 deref();
18 no_deref();
19}