xref: /llvm-project/clang/test/CodeGenHLSL/float3.hlsl (revision 762f1b17b2815ccdfb4e5cb5412cb6210db92f73)
1// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple \
2// RUN:   dxil-pc-shadermodel6.3-library %s -fnative-half-type \
3// RUN:   -emit-llvm -disable-llvm-passes -o - | FileCheck %s
4
5// Make sure float3 is not changed into float4.
6// CHECK:<3 x float> @_Z3fooDv3_f(<3 x float> noundef nofpclass(nan inf) %[[PARAM:[0-9a-zA-Z]+]])
7// CHECK:%[[A_ADDR:.+]] = alloca <3 x float>, align 16
8// CHECK-NEXT:store <3 x float> %[[PARAM]], ptr %[[A_ADDR]], align 16
9// CHECK-NEXT:%[[V:[0-9]+]] = load <3 x float>, ptr %[[A_ADDR]], align 16
10// CHECK-NEXT:ret <3 x float> %[[V]]
11float3 foo(float3 a) {
12  return a;
13}
14