blob: b8896803f9ec8fcb12eba90d81a67d314899d58e [file] [log] [blame]
SKIP: FAILED
#include <metal_stdlib>
using namespace metal;
template<typename T, size_t N>
struct tint_array {
const constant T& operator[](size_t i) const constant { return elements[i]; }
device T& operator[](size_t i) device { return elements[i]; }
const device T& operator[](size_t i) const device { return elements[i]; }
thread T& operator[](size_t i) thread { return elements[i]; }
const thread T& operator[](size_t i) const thread { return elements[i]; }
threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
T elements[N];
};
struct S {
float a;
};
thread bool bool_var = false;
thread int i32_var = 0;
thread uint u32_var = 0u;
thread float f32_var = 0.0f;
thread int2 v2i32_var = int2(0);
thread uint3 v3u32_var = uint3(0u);
thread float4 v4f32_var = float4(0.0f);
thread float2x3 m2x3_var = float2x3(float3(0.0f), float3(0.0f));
thread tint_array<float, 4> arr_var = tint_array<float, 4>{};
thread S struct_var = S{};
kernel void tint_symbol() {
bool_var = false;
i32_var = 0;
u32_var = 0u;
f32_var = 0.0f;
v2i32_var = int2(0);
v3u32_var = uint3(0u);
v4f32_var = float4(0.0f);
m2x3_var = float2x3(float3(0.0f), float3(0.0f));
arr_var = tint_array<float, 4>{};
struct_var = S{};
}
program_source:19:13: error: program scope variable must reside in constant address space
thread bool bool_var = false;
^
program_source:20:12: error: program scope variable must reside in constant address space
thread int i32_var = 0;
^
program_source:21:13: error: program scope variable must reside in constant address space
thread uint u32_var = 0u;
^
program_source:22:14: error: program scope variable must reside in constant address space
thread float f32_var = 0.0f;
^
program_source:23:13: error: program scope variable must reside in constant address space
thread int2 v2i32_var = int2(0);
^
program_source:24:14: error: program scope variable must reside in constant address space
thread uint3 v3u32_var = uint3(0u);
^
program_source:25:15: error: program scope variable must reside in constant address space
thread float4 v4f32_var = float4(0.0f);
^
program_source:26:17: error: program scope variable must reside in constant address space
thread float2x3 m2x3_var = float2x3(float3(0.0f), float3(0.0f));
^
program_source:27:29: error: program scope variable must reside in constant address space
thread tint_array<float, 4> arr_var = tint_array<float, 4>{};
^
program_source:28:10: error: program scope variable must reside in constant address space
thread S struct_var = S{};
^