Debian Codegraph @

clang/test/CodeGenHLSL/semantics/semantic.explicit-location.hlsl

raw
1 // RUN: %clang_cc1 -triple spirv-pc-vulkan1.3-pixel -x hlsl -emit-llvm -finclude-default-header -disable-llvm-passes -o - %s | FileCheck %s --check-prefix=CHECK-SPIRV
2 // RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-pixel -x hlsl -emit-llvm -finclude-default-header -disable-llvm-passes -o - %s | FileCheck %s --check-prefix=CHECK-DXIL
3
4 // CHECK-SPIRV: @SV_Target0 = external hidden thread_local addrspace(8) global <4 x float>, !spirv.Decorations ![[#MD_2:]]
5
6 // CHECK: define void @main() {{.*}} {
7 [[vk::location(2)]] float4 main(float4 p : SV_Position) : SV_Target {
8 // CHECK-SPIRV: %[[#R:]] = call spir_func <4 x float> @_Z4mainDv4_f(<4 x float> %[[#]])
9 // CHECK-SPIRV: store <4 x float> %[[#R]], ptr addrspace(8) @SV_Target0, align 16
10
11 // CHECK-DXIL: %[[#TMP:]] = call <4 x float> @_Z4mainDv4_f(<4 x float> %SV_Position0)
12 // CHECK-DXIL: call void @llvm.dx.store.output.v4f32(i32 4, i32 0, i32 0, i8 0, i32 poison, <4 x float> %[[#TMP]])
13 return p;
14 }
15
16 // CHECK-SPIRV-DAG: ![[#MD_2]] = !{![[#MD_3:]]}
17 // CHECK-SPIRV-DAG: ![[#MD_3]] = !{i32 30, i32 2}
18 // | `-> Location index
19 // `-> SPIR-V decoration 'Location'