| 1 |
// RUN: %clang_cc1 -triple spirv-pc-vulkan-compute -x hlsl -emit-llvm -finclude-default-header -disable-llvm-passes -o - %s | FileCheck %s |
| 2 |
|
| 3 |
struct S |
| 4 |
{ |
| 5 |
const static uint a = 1; |
| 6 |
uint b; |
| 7 |
}; |
| 8 |
// CHECK: %struct.S = type { i32 } |
| 9 |
|
| 10 |
[[vk::push_constant]] S s; |
| 11 |
// CHECK: @s = external hidden addrspace(13) externally_initialized global %struct.S, align 1 |
| 12 |
|
| 13 |
[numthreads(1,1,1)] |
| 14 |
void main() |
| 15 |
{ |
| 16 |
uint32_t v = s.b; |
| 17 |
// CHECK: %[[#TMP:]] = load i32, ptr addrspace(13) @s, align 1 |
| 18 |
// CHECK: store i32 %[[#TMP]], ptr %v, align 4 |
| 19 |
|
| 20 |
uint32_t w = S::a; |
| 21 |
// CHECK: store i32 1, ptr %w, align 4 |
| 22 |
|
| 23 |
uint32_t x = s.a; |
| 24 |
// CHECK: store i32 1, ptr %x, align 4 |
| 25 |
} |