blob: 4be387c702c9dbdf7bc62e563dc4a0a7a27efacf [file] [log] [blame]
SKIP: FAILED
#include <metal_stdlib>
using namespace metal;
struct str {
int i;
};
threadgroup str S;
int func(threadgroup int* const pointer) {
return pointer;
}
kernel void tint_symbol(uint tint_local_index [[thread_index_in_threadgroup]]) {
if ((tint_local_index == 0u)) {
S = str{};
}
threadgroup_barrier(mem_flags::mem_threadgroup);
int const r = func(S.i);
}
program_source:7:17: error: program scope variable must reside in constant address space
threadgroup str S;
^
program_source:9:10: error: cannot initialize return object of type 'int' with an lvalue of type 'threadgroup int *const'
return pointer;
^~~~~~~
program_source:12:25: warning: equality comparison with extraneous parentheses [-Wparentheses-equality]
if ((tint_local_index == 0u)) {
~~~~~~~~~~~~~~~~~^~~~~
program_source:12:25: note: remove extraneous parentheses around the comparison to silence this warning
if ((tint_local_index == 0u)) {
~ ^ ~
program_source:12:25: note: use '=' to turn this equality comparison into an assignment
if ((tint_local_index == 0u)) {
^~
=
program_source:16:13: warning: unused variable 'r' [-Wunused-variable]
int const r = func(S.i);
^