clang/test/CodeGenHLSL/vk-features/vk.pushconstant.anon-struct.hlsl
raw| 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 | [[vk::push_constant]] |
| 4 | struct { |
| 5 | int a; |
| 6 | float b; |
| 7 | float3 c; |
| 8 | } |
| 9 | PushConstants; |
| 10 | |
| 11 | // CHECK: %struct.anon = type <{ i32, float, <3 x float> }> |
| 12 | // CHECK: @PushConstants = external hidden addrspace(13) externally_initialized global %struct.anon, align 1 |
| 13 | |
| 14 | [numthreads(1, 1, 1)] |
| 15 | void main() { |
| 16 | float tmp = PushConstants.b; |
| 17 | } |