| 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 |
uint32_t a : 1; |
| 5 |
uint32_t b : 1; |
| 6 |
}; |
| 7 |
// CHECK: %struct.S = type { i8 } |
| 8 |
|
| 9 |
[[vk::push_constant]] S buffer; |
| 10 |
// CHECK: @buffer = external hidden addrspace(13) externally_initialized global %struct.S, align 1 |
| 11 |
|
| 12 |
[numthreads(1, 1, 1)] |
| 13 |
void main() { |
| 14 |
uint32_t v = buffer.b; |
| 15 |
// CHECK: %bf.load = load i8, ptr addrspace(13) @buffer, align 1 |
| 16 |
// CHECK: %bf.lshr = lshr i8 %bf.load, 1 |
| 17 |
// CHECK: %bf.clear = and i8 %bf.lshr, 1 |
| 18 |
// CHECK: %bf.cast = zext i8 %bf.clear to i32 |
| 19 |
// CHECK: store i32 %bf.cast |
| 20 |
} |