blob: b5cca68bacaf6e8ef618059bf2c8a08c38ae68b4 [file] [log] [blame]
SKIP: FAILED
#include <metal_stdlib>
using namespace metal;
threadgroup int S;
void func(threadgroup int* const pointer) {
pointer = 42;
}
kernel void tint_symbol(uint tint_local_index [[thread_index_in_threadgroup]]) {
if ((tint_local_index == 0u)) {
S = 0;
}
threadgroup_barrier(mem_flags::mem_threadgroup);
func(S);
}
program_source:4:17: error: program scope variable must reside in constant address space
threadgroup int S;
^
program_source:6:11: error: cannot assign to variable 'pointer' with const-qualified type 'threadgroup int *const'
pointer = 42;
~~~~~~~ ^
program_source:5:34: note: variable 'pointer' declared const here
void func(threadgroup int* const pointer) {
~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
program_source:9:25: warning: equality comparison with extraneous parentheses [-Wparentheses-equality]
if ((tint_local_index == 0u)) {
~~~~~~~~~~~~~~~~~^~~~~
program_source:9:25: note: remove extraneous parentheses around the comparison to silence this warning
if ((tint_local_index == 0u)) {
~ ^ ~
program_source:9:25: note: use '=' to turn this equality comparison into an assignment
if ((tint_local_index == 0u)) {
^~
=