From e5dec8b6705106de1da3d59dc29acf15018e9aba Mon Sep 17 00:00:00 2001 From: Greg Roth Date: Tue, 8 Oct 2024 22:40:29 -0600 Subject: [PATCH] Switch DirectX Target to use the Itanium ABI To consolidate behavior of function mangling and limit the number of places that ABI changes will need to be made, this switches the DirectX target used for HLSL to use the Itanium ABI from the Microsoft ABI. The Itanium ABI has greater flexibility in decisions regarding mangling of new types of which we have more than a few yet to add. This required adding a function to call all global destructors as the Microsoft ABI had done. This requires a few changes to tests. Most notably the mangling style has changed which accounts for most of the changes. In making those changes, I took the opportunity to harmonize some very similar tests for greater consistency. I also shaved off some unneeded run flags that had probably been copied over from one test to another. Other changes effected by using the new ABI include using smaller types when possible in a few instances, eliminating an unnecessary alloca in one instance in this-assignment.hlsl, and changing the order of inout parameters getting copied in and out. That last is a subtle change in functionality, but one where there was sufficient inconsistency in the past that standardizing is important, but the particular direction of the standardization is less important for the sake of existing shaders. fixes #110736 --- clang/lib/Basic/Targets/DirectX.h | 2 +- clang/lib/CodeGen/ItaniumCXXABI.cpp | 4 + clang/test/CodeGenHLSL/ArrayTemporary.hlsl | 8 +- .../BasicFeatures/OutputArguments.hlsl | 26 ++-- .../GlobalConstructorFunction.hlsl | 8 +- .../CodeGenHLSL/GlobalConstructorLib.hlsl | 12 +- .../test/CodeGenHLSL/GlobalConstructors.hlsl | 2 +- clang/test/CodeGenHLSL/GlobalDestructors.hlsl | 14 +- clang/test/CodeGenHLSL/basic_types.hlsl | 64 ++++----- .../builtins/RWBuffer-annotations.hlsl | 12 +- .../builtins/RWBuffer-elementtype.hlsl | 26 ++-- .../RasterizerOrderedBuffer-annotations.hlsl | 12 +- .../StructuredBuffer-annotations.hlsl | 12 +- .../StructuredBuffer-elementtype.hlsl | 26 ++-- clang/test/CodeGenHLSL/builtins/abs.hlsl | 73 ++++++----- clang/test/CodeGenHLSL/builtins/ceil.hlsl | 37 +++--- clang/test/CodeGenHLSL/builtins/clamp.hlsl | 101 +++++++------- clang/test/CodeGenHLSL/builtins/cos.hlsl | 37 +++--- clang/test/CodeGenHLSL/builtins/exp.hlsl | 37 +++--- clang/test/CodeGenHLSL/builtins/exp2.hlsl | 37 +++--- clang/test/CodeGenHLSL/builtins/floor.hlsl | 37 +++--- .../CodeGenHLSL/builtins/hlsl_resource_t.hlsl | 4 +- clang/test/CodeGenHLSL/builtins/log.hlsl | 37 +++--- clang/test/CodeGenHLSL/builtins/log10.hlsl | 37 +++--- clang/test/CodeGenHLSL/builtins/log2.hlsl | 37 +++--- clang/test/CodeGenHLSL/builtins/max.hlsl | 101 +++++++------- clang/test/CodeGenHLSL/builtins/min.hlsl | 101 +++++++------- clang/test/CodeGenHLSL/builtins/pow.hlsl | 37 +++--- clang/test/CodeGenHLSL/builtins/round.hlsl | 37 +++--- clang/test/CodeGenHLSL/builtins/saturate.hlsl | 123 +++++++----------- clang/test/CodeGenHLSL/builtins/sin.hlsl | 37 +++--- clang/test/CodeGenHLSL/builtins/sqrt.hlsl | 37 +++--- clang/test/CodeGenHLSL/builtins/trunc.hlsl | 39 +++--- clang/test/CodeGenHLSL/export.hlsl | 11 +- clang/test/CodeGenHLSL/float3.hlsl | 2 +- clang/test/CodeGenHLSL/group_shared.hlsl | 2 +- clang/test/CodeGenHLSL/half.hlsl | 4 +- .../implicit-norecurse-attrib.hlsl | 8 +- .../test/CodeGenHLSL/inline-constructors.hlsl | 4 +- clang/test/CodeGenHLSL/inline-functions.hlsl | 10 +- .../semantics/GroupIndex-codegen.hlsl | 2 +- clang/test/CodeGenHLSL/shift-mask.hlsl | 43 +++++- clang/test/CodeGenHLSL/sret_output.hlsl | 7 +- clang/test/CodeGenHLSL/static-local-ctor.hlsl | 14 +- .../static_global_and_function_in_cb.hlsl | 7 +- .../CodeGenHLSL/this-assignment-overload.hlsl | 8 +- clang/test/CodeGenHLSL/this-assignment.hlsl | 7 +- clang/test/CodeGenHLSL/this-reference.hlsl | 4 +- 48 files changed, 667 insertions(+), 680 deletions(-) diff --git a/clang/lib/Basic/Targets/DirectX.h b/clang/lib/Basic/Targets/DirectX.h index cf7ea5e83503d..19b61252409b0 100644 --- a/clang/lib/Basic/Targets/DirectX.h +++ b/clang/lib/Basic/Targets/DirectX.h @@ -62,7 +62,7 @@ class LLVM_LIBRARY_VISIBILITY DirectXTargetInfo : public TargetInfo { PlatformName = llvm::Triple::getOSTypeName(Triple.getOS()); resetDataLayout("e-m:e-p:32:32-i1:32-i8:8-i16:16-i32:32-i64:64-f16:16-f32:" "32-f64:64-n8:16:32:64"); - TheCXXABI.set(TargetCXXABI::Microsoft); + TheCXXABI.set(TargetCXXABI::GenericItanium); } bool useFP16ConversionIntrinsics() const override { return false; } void getTargetDefines(const LangOptions &Opts, diff --git a/clang/lib/CodeGen/ItaniumCXXABI.cpp b/clang/lib/CodeGen/ItaniumCXXABI.cpp index 965e09a7a760e..75dab596e1b2c 100644 --- a/clang/lib/CodeGen/ItaniumCXXABI.cpp +++ b/clang/lib/CodeGen/ItaniumCXXABI.cpp @@ -2997,6 +2997,10 @@ void ItaniumCXXABI::registerGlobalDtor(CodeGenFunction &CGF, const VarDecl &D, if (D.isNoDestroy(CGM.getContext())) return; + // HLSL doesn't support atexit. + if (CGM.getLangOpts().HLSL) + return CGM.AddCXXDtorEntry(dtor, addr); + // OpenMP offloading supports C++ constructors and destructors but we do not // always have 'atexit' available. Instead lower these to use the LLVM global // destructors which we can handle directly in the runtime. Note that this is diff --git a/clang/test/CodeGenHLSL/ArrayTemporary.hlsl b/clang/test/CodeGenHLSL/ArrayTemporary.hlsl index 63a30b61440eb..7d77c0aff736c 100644 --- a/clang/test/CodeGenHLSL/ArrayTemporary.hlsl +++ b/clang/test/CodeGenHLSL/ArrayTemporary.hlsl @@ -68,11 +68,11 @@ void call4(float Arr[2][2]) { // CHECK: [[Tmp2:%.*]] = alloca [4 x float] // CHECK: [[Tmp3:%.*]] = alloca [3 x i32] // CHECK: call void @llvm.memcpy.p0.p0.i32(ptr align 4 [[Tmp1]], ptr align 4 [[FA2]], i32 8, i1 false) -// CHECK: call void @"??$template_fn@$$BY01M@@YAXY01M@Z"(ptr noundef byval([2 x float]) align 4 [[Tmp1]]) +// CHECK: call void @_Z11template_fnIA2_fEvT_(ptr noundef byval([2 x float]) align 4 [[Tmp1]]) // CHECK: call void @llvm.memcpy.p0.p0.i32(ptr align 4 [[Tmp2]], ptr align 4 [[FA4]], i32 16, i1 false) -// CHECK: call void @"??$template_fn@$$BY03M@@YAXY03M@Z"(ptr noundef byval([4 x float]) align 4 [[Tmp2]]) +// CHECK: call void @_Z11template_fnIA4_fEvT_(ptr noundef byval([4 x float]) align 4 [[Tmp2]]) // CHECK: call void @llvm.memcpy.p0.p0.i32(ptr align 4 [[Tmp3]], ptr align 4 [[IA3]], i32 12, i1 false) -// CHECK: call void @"??$template_fn@$$BY02H@@YAXY02H@Z"(ptr noundef byval([3 x i32]) align 4 [[Tmp3]]) +// CHECK: call void @_Z11template_fnIA3_iEvT_(ptr noundef byval([3 x i32]) align 4 [[Tmp3]]) template void template_fn(T Val) {} @@ -90,7 +90,7 @@ void template_call(float FA2[2], float FA4[4], int IA3[3]) { // CHECK: [[Addr:%.*]] = getelementptr inbounds [2 x float], ptr [[FA2]], i32 0, i32 0 // CHECK: [[Tmp:%.*]] = load float, ptr [[Addr]] -// CHECK: call void @"??$template_fn@M@@YAXM@Z"(float noundef [[Tmp]]) +// CHECK: call void @_Z11template_fnIfEvT_(float noundef [[Tmp]]) // CHECK: [[Idx0:%.*]] = getelementptr inbounds [2 x float], ptr [[FA2]], i32 0, i32 0 // CHECK: [[Val0:%.*]] = load float, ptr [[Idx0]] diff --git a/clang/test/CodeGenHLSL/BasicFeatures/OutputArguments.hlsl b/clang/test/CodeGenHLSL/BasicFeatures/OutputArguments.hlsl index 58237889db1dc..6afead4f23366 100644 --- a/clang/test/CodeGenHLSL/BasicFeatures/OutputArguments.hlsl +++ b/clang/test/CodeGenHLSL/BasicFeatures/OutputArguments.hlsl @@ -260,10 +260,10 @@ void order_matters(inout int X, inout int Y) { // CHECK: store i32 [[VVal]], ptr [[Tmp0]] // CHECK: [[VVal:%.*]] = load i32, ptr [[V]] // CHECK: store i32 [[VVal]], ptr [[Tmp1]] -// CHECK: call void {{.*}}order_matters{{.*}}(ptr noalias noundef nonnull align 4 dereferenceable(4) [[Tmp1]], ptr noalias noundef nonnull align 4 dereferenceable(4) [[Tmp0]]) -// CHECK: [[Arg1Val:%.*]] = load i32, ptr [[Tmp1]] +// CHECK: call void {{.*}}order_matters{{.*}}(ptr noalias noundef nonnull align 4 dereferenceable(4) [[Tmp0]], ptr noalias noundef nonnull align 4 dereferenceable(4) [[Tmp1]]) +// CHECK: [[Arg1Val:%.*]] = load i32, ptr [[Tmp0]] // CHECK: store i32 [[Arg1Val]], ptr [[V]] -// CHECK: [[Arg2Val:%.*]] = load i32, ptr [[Tmp0]] +// CHECK: [[Arg2Val:%.*]] = load i32, ptr [[Tmp1]] // CHECK: store i32 [[Arg2Val]], ptr [[V]] // OPT: ret i32 2 @@ -289,17 +289,19 @@ void setFour(inout int I) { // CHECK: [[B:%.*]] = alloca %struct.B // CHECK: [[Tmp:%.*]] = alloca i32 -// CHECK: [[BFLoad:%.*]] = load i32, ptr [[B]] -// CHECK: [[BFshl:%.*]] = shl i32 [[BFLoad]], 24 -// CHECK: [[BFashr:%.*]] = ashr i32 [[BFshl]], 24 -// CHECK: store i32 [[BFashr]], ptr [[Tmp]] +// CHECK: [[BFLoad:%.*]] = load i16, ptr [[B]] +// CHECK: [[BFshl:%.*]] = shl i16 [[BFLoad]], 8 +// CHECK: [[BFashr:%.*]] = ashr i16 [[BFshl]], 8 +// CHECK: [[BFcast:%.*]] = sext i16 [[BFashr]] to i32 +// CHECK: store i32 [[BFcast]], ptr [[Tmp]] // CHECK: call void {{.*}}setFour{{.*}}(ptr noalias noundef nonnull align 4 dereferenceable(4) [[Tmp]]) // CHECK: [[RetVal:%.*]] = load i32, ptr [[Tmp]] -// CHECK: [[BFLoad:%.*]] = load i32, ptr [[B]] -// CHECK: [[BFValue:%.*]] = and i32 [[RetVal]], 255 -// CHECK: [[ZerodField:%.*]] = and i32 [[BFLoad]], -256 -// CHECK: [[BFSet:%.*]] = or i32 [[ZerodField]], [[BFValue]] -// CHECK: store i32 [[BFSet]], ptr [[B]] +// CHECK: [[TruncVal:%.*]] = trunc i32 [[RetVal]] to i16 +// CHECK: [[BFLoad:%.*]] = load i16, ptr [[B]] +// CHECK: [[BFValue:%.*]] = and i16 [[TruncVal]], 255 +// CHECK: [[ZerodField:%.*]] = and i16 [[BFLoad]], -256 +// CHECK: [[BFSet:%.*]] = or i16 [[ZerodField]], [[BFValue]] +// CHECK: store i16 [[BFSet]], ptr [[B]] // OPT: ret i32 8 export int case11() { diff --git a/clang/test/CodeGenHLSL/GlobalConstructorFunction.hlsl b/clang/test/CodeGenHLSL/GlobalConstructorFunction.hlsl index b39311ad67cd6..c0eb1b138ed04 100644 --- a/clang/test/CodeGenHLSL/GlobalConstructorFunction.hlsl +++ b/clang/test/CodeGenHLSL/GlobalConstructorFunction.hlsl @@ -25,11 +25,11 @@ void main(unsigned GI : SV_GroupIndex) {} // CHECK: define void @main() // CHECK-NEXT: entry: // Verify function constructors are emitted -// NOINLINE-NEXT: call void @"?call_me_first@@YAXXZ"() -// NOINLINE-NEXT: call void @"?then_call_me@@YAXXZ"() +// NOINLINE-NEXT: call void @_Z13call_me_firstv() +// NOINLINE-NEXT: call void @_Z12then_call_mev() // NOINLINE-NEXT: %0 = call i32 @llvm.dx.flattened.thread.id.in.group() -// NOINLINE-NEXT: call void @"?main@@YAXI@Z"(i32 %0) -// NOINLINE-NEXT: call void @"?call_me_last@@YAXXZ"( +// NOINLINE-NEXT: call void @_Z4mainj(i32 %0) +// NOINLINE-NEXT: call void @_Z12call_me_lastv( // NOINLINE-NEXT: ret void // Verify constructor calls are inlined when AlwaysInline is run diff --git a/clang/test/CodeGenHLSL/GlobalConstructorLib.hlsl b/clang/test/CodeGenHLSL/GlobalConstructorLib.hlsl index 78f6475462bc4..09c44f6242c53 100644 --- a/clang/test/CodeGenHLSL/GlobalConstructorLib.hlsl +++ b/clang/test/CodeGenHLSL/GlobalConstructorLib.hlsl @@ -13,7 +13,7 @@ void FirstEntry() {} // CHECK: define void @FirstEntry() // CHECK-NEXT: entry: // NOINLINE-NEXT: call void @_GLOBAL__sub_I_GlobalConstructorLib.hlsl() -// NOINLINE-NEXT: call void @"?FirstEntry@@YAXXZ"() +// NOINLINE-NEXT: call void @_Z10FirstEntryv() // Verify inlining leaves only calls to "llvm." intrinsics // INLINE-NOT: call {{[^@]*}} @{{[^l][^l][^v][^m][^\.]}} // CHECK: ret void @@ -25,7 +25,7 @@ void SecondEntry() {} // CHECK: define void @SecondEntry() // CHECK-NEXT: entry: // NOINLINE-NEXT: call void @_GLOBAL__sub_I_GlobalConstructorLib.hlsl() -// NOINLINE-NEXT: call void @"?SecondEntry@@YAXXZ"() +// NOINLINE-NEXT: call void @_Z11SecondEntryv() // Verify inlining leaves only calls to "llvm." intrinsics // INLINE-NOT: call {{[^@]*}} @{{[^l][^l][^v][^m][^\.]}} // CHECK: ret void @@ -33,6 +33,10 @@ void SecondEntry() {} // Verify the constructor is alwaysinline // NOINLINE: ; Function Attrs: {{.*}}alwaysinline -// NOINLINE-NEXT: define internal void @_GLOBAL__sub_I_GlobalConstructorLib.hlsl() [[IntAttr:\#[0-9]+]] +// NOINLINE-NEXT: define linkonce_odr void @_ZN4hlsl8RWBufferIfEC2Ev({{.*}} [[CtorAttr:\#[0-9]+]] -// NOINLINE: attributes [[IntAttr]] = {{.*}} alwaysinline +// NOINLINE: ; Function Attrs: {{.*}}alwaysinline +// NOINLINE-NEXT: define internal void @_GLOBAL__sub_I_GlobalConstructorLib.hlsl() [[InitAttr:\#[0-9]+]] + +// NOINLINE-DAG: attributes [[InitAttr]] = {{.*}} alwaysinline +// NOINLINE-DAG: attributes [[CtorAttr]] = {{.*}} alwaysinline diff --git a/clang/test/CodeGenHLSL/GlobalConstructors.hlsl b/clang/test/CodeGenHLSL/GlobalConstructors.hlsl index 7e2f288726c95..7b26dba0d1901 100644 --- a/clang/test/CodeGenHLSL/GlobalConstructors.hlsl +++ b/clang/test/CodeGenHLSL/GlobalConstructors.hlsl @@ -12,5 +12,5 @@ void main(unsigned GI : SV_GroupIndex) {} //CHECK-NEXT: entry: //CHECK-NEXT: call void @_GLOBAL__sub_I_GlobalConstructors.hlsl() //CHECK-NEXT: %0 = call i32 @llvm.dx.flattened.thread.id.in.group() -//CHECK-NEXT: call void @"?main@@YAXI@Z"(i32 %0) +//CHECK-NEXT: call void @_Z4mainj(i32 %0) //CHECK-NEXT: ret void diff --git a/clang/test/CodeGenHLSL/GlobalDestructors.hlsl b/clang/test/CodeGenHLSL/GlobalDestructors.hlsl index ea28354222f88..f98318601134b 100644 --- a/clang/test/CodeGenHLSL/GlobalDestructors.hlsl +++ b/clang/test/CodeGenHLSL/GlobalDestructors.hlsl @@ -1,7 +1,7 @@ -// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -std=hlsl202x -emit-llvm -disable-llvm-passes %s -o - | FileCheck %s --check-prefixes=CS,NOINLINE,CHECK -// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -std=hlsl202x -emit-llvm -disable-llvm-passes %s -o - | FileCheck %s --check-prefixes=LIB,NOINLINE,CHECK -// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -std=hlsl202x -emit-llvm -O0 %s -o - | FileCheck %s --check-prefixes=INLINE,CHECK -// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -std=hlsl202x -emit-llvm -O0 %s -o - | FileCheck %s --check-prefixes=INLINE,CHECK +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -emit-llvm -disable-llvm-passes %s -o - | FileCheck %s --check-prefixes=CS,NOINLINE,CHECK +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -emit-llvm -disable-llvm-passes %s -o - | FileCheck %s --check-prefixes=LIB,NOINLINE,CHECK +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -emit-llvm -O0 %s -o - | FileCheck %s --check-prefixes=INLINE,CHECK +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -emit-llvm -O0 %s -o - | FileCheck %s --check-prefixes=INLINE,CHECK // Tests that constructors and destructors are appropriately generated for globals // and that their calls are inlined when AlwaysInline is run @@ -59,7 +59,7 @@ void main(unsigned GI : SV_GroupIndex) { // Verify destructor is emitted // NOINLINE-NEXT: call void @_GLOBAL__sub_I_GlobalDestructors.hlsl() // NOINLINE-NEXT: %0 = call i32 @llvm.dx.flattened.thread.id.in.group() -// NOINLINE-NEXT: call void @"?main@@YAXI@Z"(i32 %0) +// NOINLINE-NEXT: call void @_Z4mainj(i32 %0) // NOINLINE-NEXT: call void @_GLOBAL__D_a() // NOINLINE-NEXT: ret void // Verify inlining leaves only calls to "llvm." intrinsics @@ -71,8 +71,8 @@ void main(unsigned GI : SV_GroupIndex) { // NOINLINE: define internal void @_GLOBAL__D_a() [[IntAttr:\#[0-9]+]] // NOINLINE-NEXT: entry: -// NOINLINE-NEXT: call void @"??1Tail@@QAA@XZ"(ptr @"?T@?1??Wag@@YAXXZ@4UTail@@A") -// NOINLINE-NEXT: call void @"??1Pupper@@QAA@XZ"(ptr @"?GlobalPup@@3UPupper@@A") +// NOINLINE-NEXT: call void @_ZN4TailD1Ev(ptr @_ZZ3WagvE1T) +// NOINLINE-NEXT: call void @_ZN6PupperD1Ev(ptr @GlobalPup) // NOINLINE-NEXT: ret void // NOINLINE: attributes [[IntAttr]] = {{.*}} alwaysinline diff --git a/clang/test/CodeGenHLSL/basic_types.hlsl b/clang/test/CodeGenHLSL/basic_types.hlsl index 15c963dfa666f..d987af45a649f 100644 --- a/clang/test/CodeGenHLSL/basic_types.hlsl +++ b/clang/test/CodeGenHLSL/basic_types.hlsl @@ -6,38 +6,38 @@ // RUN: -emit-llvm -disable-llvm-passes -o - -DNAMESPACED| FileCheck %s -// CHECK:"?uint16_t_Val@@3GA" = global i16 0, align 2 -// CHECK:"?int16_t_Val@@3FA" = global i16 0, align 2 -// CHECK:"?uint_Val@@3IA" = global i32 0, align 4 -// CHECK:"?uint64_t_Val@@3KA" = global i64 0, align 8 -// CHECK:"?int64_t_Val@@3JA" = global i64 0, align 8 -// CHECK:"?int16_t2_Val@@3T?$__vector@F$01@__clang@@A" = global <2 x i16> zeroinitializer, align 4 -// CHECK:"?int16_t3_Val@@3T?$__vector@F$02@__clang@@A" = global <3 x i16> zeroinitializer, align 8 -// CHECK:"?int16_t4_Val@@3T?$__vector@F$03@__clang@@A" = global <4 x i16> zeroinitializer, align 8 -// CHECK:"?uint16_t2_Val@@3T?$__vector@G$01@__clang@@A" = global <2 x i16> zeroinitializer, align 4 -// CHECK:"?uint16_t3_Val@@3T?$__vector@G$02@__clang@@A" = global <3 x i16> zeroinitializer, align 8 -// CHECK:"?uint16_t4_Val@@3T?$__vector@G$03@__clang@@A" = global <4 x i16> zeroinitializer, align 8 -// CHECK:"?int2_Val@@3T?$__vector@H$01@__clang@@A" = global <2 x i32> zeroinitializer, align 8 -// CHECK:"?int3_Val@@3T?$__vector@H$02@__clang@@A" = global <3 x i32> zeroinitializer, align 16 -// CHECK:"?int4_Val@@3T?$__vector@H$03@__clang@@A" = global <4 x i32> zeroinitializer, align 16 -// CHECK:"?uint2_Val@@3T?$__vector@I$01@__clang@@A" = global <2 x i32> zeroinitializer, align 8 -// CHECK:"?uint3_Val@@3T?$__vector@I$02@__clang@@A" = global <3 x i32> zeroinitializer, align 16 -// CHECK:"?uint4_Val@@3T?$__vector@I$03@__clang@@A" = global <4 x i32> zeroinitializer, align 16 -// CHECK:"?int64_t2_Val@@3T?$__vector@J$01@__clang@@A" = global <2 x i64> zeroinitializer, align 16 -// CHECK:"?int64_t3_Val@@3T?$__vector@J$02@__clang@@A" = global <3 x i64> zeroinitializer, align 32 -// CHECK:"?int64_t4_Val@@3T?$__vector@J$03@__clang@@A" = global <4 x i64> zeroinitializer, align 32 -// CHECK:"?uint64_t2_Val@@3T?$__vector@K$01@__clang@@A" = global <2 x i64> zeroinitializer, align 16 -// CHECK:"?uint64_t3_Val@@3T?$__vector@K$02@__clang@@A" = global <3 x i64> zeroinitializer, align 32 -// CHECK:"?uint64_t4_Val@@3T?$__vector@K$03@__clang@@A" = global <4 x i64> zeroinitializer, align 32 -// CHECK:"?half2_Val@@3T?$__vector@$f16@$01@__clang@@A" = global <2 x half> zeroinitializer, align 4 -// CHECK:"?half3_Val@@3T?$__vector@$f16@$02@__clang@@A" = global <3 x half> zeroinitializer, align 8 -// CHECK:"?half4_Val@@3T?$__vector@$f16@$03@__clang@@A" = global <4 x half> zeroinitializer, align 8 -// CHECK:"?float2_Val@@3T?$__vector@M$01@__clang@@A" = global <2 x float> zeroinitializer, align 8 -// CHECK:"?float3_Val@@3T?$__vector@M$02@__clang@@A" = global <3 x float> zeroinitializer, align 16 -// CHECK:"?float4_Val@@3T?$__vector@M$03@__clang@@A" = global <4 x float> zeroinitializer, align 16 -// CHECK:"?double2_Val@@3T?$__vector@N$01@__clang@@A" = global <2 x double> zeroinitializer, align 16 -// CHECK:"?double3_Val@@3T?$__vector@N$02@__clang@@A" = global <3 x double> zeroinitializer, align 32 -// CHECK:"?double4_Val@@3T?$__vector@N$03@__clang@@A" = global <4 x double> zeroinitializer, align 32 +// CHECK: @uint16_t_Val = global i16 0, align 2 +// CHECK: @int16_t_Val = global i16 0, align 2 +// CHECK: @uint_Val = global i32 0, align 4 +// CHECK: @uint64_t_Val = global i64 0, align 8 +// CHECK: @int64_t_Val = global i64 0, align 8 +// CHECK: @int16_t2_Val = global <2 x i16> zeroinitializer, align 4 +// CHECK: @int16_t3_Val = global <3 x i16> zeroinitializer, align 8 +// CHECK: @int16_t4_Val = global <4 x i16> zeroinitializer, align 8 +// CHECK: @uint16_t2_Val = global <2 x i16> zeroinitializer, align 4 +// CHECK: @uint16_t3_Val = global <3 x i16> zeroinitializer, align 8 +// CHECK: @uint16_t4_Val = global <4 x i16> zeroinitializer, align 8 +// CHECK: @int2_Val = global <2 x i32> zeroinitializer, align 8 +// CHECK: @int3_Val = global <3 x i32> zeroinitializer, align 16 +// CHECK: @int4_Val = global <4 x i32> zeroinitializer, align 16 +// CHECK: @uint2_Val = global <2 x i32> zeroinitializer, align 8 +// CHECK: @uint3_Val = global <3 x i32> zeroinitializer, align 16 +// CHECK: @uint4_Val = global <4 x i32> zeroinitializer, align 16 +// CHECK: @int64_t2_Val = global <2 x i64> zeroinitializer, align 16 +// CHECK: @int64_t3_Val = global <3 x i64> zeroinitializer, align 32 +// CHECK: @int64_t4_Val = global <4 x i64> zeroinitializer, align 32 +// CHECK: @uint64_t2_Val = global <2 x i64> zeroinitializer, align 16 +// CHECK: @uint64_t3_Val = global <3 x i64> zeroinitializer, align 32 +// CHECK: @uint64_t4_Val = global <4 x i64> zeroinitializer, align 32 +// CHECK: @half2_Val = global <2 x half> zeroinitializer, align 4 +// CHECK: @half3_Val = global <3 x half> zeroinitializer, align 8 +// CHECK: @half4_Val = global <4 x half> zeroinitializer, align 8 +// CHECK: @float2_Val = global <2 x float> zeroinitializer, align 8 +// CHECK: @float3_Val = global <3 x float> zeroinitializer, align 16 +// CHECK: @float4_Val = global <4 x float> zeroinitializer, align 16 +// CHECK: @double2_Val = global <2 x double> zeroinitializer, align 16 +// CHECK: @double3_Val = global <3 x double> zeroinitializer, align 32 +// CHECK: @double4_Val = global <4 x double> zeroinitializer, align 32 #ifdef NAMESPACED #define TYPE_DECL(T) hlsl::T T##_Val diff --git a/clang/test/CodeGenHLSL/builtins/RWBuffer-annotations.hlsl b/clang/test/CodeGenHLSL/builtins/RWBuffer-annotations.hlsl index 7ca78e60fb9c5..e1e047485e4df 100644 --- a/clang/test/CodeGenHLSL/builtins/RWBuffer-annotations.hlsl +++ b/clang/test/CodeGenHLSL/builtins/RWBuffer-annotations.hlsl @@ -16,9 +16,9 @@ void main() { } // CHECK: !hlsl.uavs = !{![[Single:[0-9]+]], ![[Array:[0-9]+]], ![[SingleAllocated:[0-9]+]], ![[ArrayAllocated:[0-9]+]], ![[SingleSpace:[0-9]+]], ![[ArraySpace:[0-9]+]]} -// CHECK-DAG: ![[Single]] = !{ptr @"?Buffer1@@3V?$RWBuffer@M@hlsl@@A", i32 10, i32 9, i1 false, i32 -1, i32 0} -// CHECK-DAG: ![[Array]] = !{ptr @"?BufferArray@@3PAV?$RWBuffer@T?$__vector@M$03@__clang@@@hlsl@@A", i32 10, i32 9, i1 false, i32 -1, i32 0} -// CHECK-DAG: ![[SingleAllocated]] = !{ptr @"?Buffer2@@3V?$RWBuffer@M@hlsl@@A", i32 10, i32 9, i1 false, i32 3, i32 0} -// CHECK-DAG: ![[ArrayAllocated]] = !{ptr @"?BufferArray2@@3PAV?$RWBuffer@T?$__vector@M$03@__clang@@@hlsl@@A", i32 10, i32 9, i1 false, i32 4, i32 0} -// CHECK-DAG: ![[SingleSpace]] = !{ptr @"?Buffer3@@3V?$RWBuffer@M@hlsl@@A", i32 10, i32 9, i1 false, i32 3, i32 1} -// CHECK-DAG: ![[ArraySpace]] = !{ptr @"?BufferArray3@@3PAV?$RWBuffer@T?$__vector@M$03@__clang@@@hlsl@@A", i32 10, i32 9, i1 false, i32 4, i32 1} +// CHECK-DAG: ![[Single]] = !{ptr @Buffer1, i32 10, i32 9, i1 false, i32 -1, i32 0} +// CHECK-DAG: ![[Array]] = !{ptr @BufferArray, i32 10, i32 9, i1 false, i32 -1, i32 0} +// CHECK-DAG: ![[SingleAllocated]] = !{ptr @Buffer2, i32 10, i32 9, i1 false, i32 3, i32 0} +// CHECK-DAG: ![[ArrayAllocated]] = !{ptr @BufferArray2, i32 10, i32 9, i1 false, i32 4, i32 0} +// CHECK-DAG: ![[SingleSpace]] = !{ptr @Buffer3, i32 10, i32 9, i1 false, i32 3, i32 1} +// CHECK-DAG: ![[ArraySpace]] = !{ptr @BufferArray3, i32 10, i32 9, i1 false, i32 4, i32 1} diff --git a/clang/test/CodeGenHLSL/builtins/RWBuffer-elementtype.hlsl b/clang/test/CodeGenHLSL/builtins/RWBuffer-elementtype.hlsl index 036c9c28ef277..eca4f1598fd65 100644 --- a/clang/test/CodeGenHLSL/builtins/RWBuffer-elementtype.hlsl +++ b/clang/test/CodeGenHLSL/builtins/RWBuffer-elementtype.hlsl @@ -37,16 +37,16 @@ void main(int GI : SV_GroupIndex) { BufF32x3[GI] = 0; } -// CHECK: !{{[0-9]+}} = !{ptr @"?BufI16@@3V?$RWBuffer@F@hlsl@@A", i32 10, i32 2, -// CHECK: !{{[0-9]+}} = !{ptr @"?BufU16@@3V?$RWBuffer@G@hlsl@@A", i32 10, i32 3, -// CHECK: !{{[0-9]+}} = !{ptr @"?BufI32@@3V?$RWBuffer@H@hlsl@@A", i32 10, i32 4, -// CHECK: !{{[0-9]+}} = !{ptr @"?BufU32@@3V?$RWBuffer@I@hlsl@@A", i32 10, i32 5, -// CHECK: !{{[0-9]+}} = !{ptr @"?BufI64@@3V?$RWBuffer@J@hlsl@@A", i32 10, i32 6, -// CHECK: !{{[0-9]+}} = !{ptr @"?BufU64@@3V?$RWBuffer@K@hlsl@@A", i32 10, i32 7, -// CHECK: !{{[0-9]+}} = !{ptr @"?BufF16@@3V?$RWBuffer@$f16@@hlsl@@A", i32 10, i32 8, -// CHECK: !{{[0-9]+}} = !{ptr @"?BufF32@@3V?$RWBuffer@M@hlsl@@A", i32 10, i32 9, -// CHECK: !{{[0-9]+}} = !{ptr @"?BufF64@@3V?$RWBuffer@N@hlsl@@A", i32 10, i32 10, -// CHECK: !{{[0-9]+}} = !{ptr @"?BufI16x4@@3V?$RWBuffer@T?$__vector@F$03@__clang@@@hlsl@@A", i32 10, i32 2, -// CHECK: !{{[0-9]+}} = !{ptr @"?BufU32x3@@3V?$RWBuffer@T?$__vector@I$02@__clang@@@hlsl@@A", i32 10, i32 5, -// CHECK: !{{[0-9]+}} = !{ptr @"?BufF16x2@@3V?$RWBuffer@T?$__vector@$f16@$01@__clang@@@hlsl@@A", i32 10, i32 8, -// CHECK: !{{[0-9]+}} = !{ptr @"?BufF32x3@@3V?$RWBuffer@T?$__vector@M$02@__clang@@@hlsl@@A", i32 10, i32 9, +// CHECK: !{{[0-9]+}} = !{ptr @BufI16, i32 10, i32 2, +// CHECK: !{{[0-9]+}} = !{ptr @BufU16, i32 10, i32 3, +// CHECK: !{{[0-9]+}} = !{ptr @BufI32, i32 10, i32 4, +// CHECK: !{{[0-9]+}} = !{ptr @BufU32, i32 10, i32 5, +// CHECK: !{{[0-9]+}} = !{ptr @BufI64, i32 10, i32 6, +// CHECK: !{{[0-9]+}} = !{ptr @BufU64, i32 10, i32 7, +// CHECK: !{{[0-9]+}} = !{ptr @BufF16, i32 10, i32 8, +// CHECK: !{{[0-9]+}} = !{ptr @BufF32, i32 10, i32 9, +// CHECK: !{{[0-9]+}} = !{ptr @BufF64, i32 10, i32 10, +// CHECK: !{{[0-9]+}} = !{ptr @BufI16x4, i32 10, i32 2, +// CHECK: !{{[0-9]+}} = !{ptr @BufU32x3, i32 10, i32 5, +// CHECK: !{{[0-9]+}} = !{ptr @BufF16x2, i32 10, i32 8, +// CHECK: !{{[0-9]+}} = !{ptr @BufF32x3, i32 10, i32 9, diff --git a/clang/test/CodeGenHLSL/builtins/RasterizerOrderedBuffer-annotations.hlsl b/clang/test/CodeGenHLSL/builtins/RasterizerOrderedBuffer-annotations.hlsl index bf70cc2456c8b..5155f12902597 100644 --- a/clang/test/CodeGenHLSL/builtins/RasterizerOrderedBuffer-annotations.hlsl +++ b/clang/test/CodeGenHLSL/builtins/RasterizerOrderedBuffer-annotations.hlsl @@ -12,9 +12,9 @@ RasterizerOrderedBuffer > BufferArray3[4] : register(u4, space1 void main() {} // CHECK: !hlsl.uavs = !{![[Single:[0-9]+]], ![[Array:[0-9]+]], ![[SingleAllocated:[0-9]+]], ![[ArrayAllocated:[0-9]+]], ![[SingleSpace:[0-9]+]], ![[ArraySpace:[0-9]+]]} -// CHECK-DAG: ![[Single]] = !{ptr @"?Buffer1@@3V?$RasterizerOrderedBuffer@M@hlsl@@A", i32 10, i32 9, i1 true, i32 -1, i32 0} -// CHECK-DAG: ![[Array]] = !{ptr @"?BufferArray@@3PAV?$RasterizerOrderedBuffer@T?$__vector@M$03@__clang@@@hlsl@@A", i32 10, i32 9, i1 true, i32 -1, i32 0} -// CHECK-DAG: ![[SingleAllocated]] = !{ptr @"?Buffer2@@3V?$RasterizerOrderedBuffer@M@hlsl@@A", i32 10, i32 9, i1 true, i32 3, i32 0} -// CHECK-DAG: ![[ArrayAllocated]] = !{ptr @"?BufferArray2@@3PAV?$RasterizerOrderedBuffer@T?$__vector@M$03@__clang@@@hlsl@@A", i32 10, i32 9, i1 true, i32 4, i32 0} -// CHECK-DAG: ![[SingleSpace]] = !{ptr @"?Buffer3@@3V?$RasterizerOrderedBuffer@M@hlsl@@A", i32 10, i32 9, i1 true, i32 3, i32 1} -// CHECK-DAG: ![[ArraySpace]] = !{ptr @"?BufferArray3@@3PAV?$RasterizerOrderedBuffer@T?$__vector@M$03@__clang@@@hlsl@@A", i32 10, i32 9, i1 true, i32 4, i32 1} +// CHECK-DAG: ![[Single]] = !{ptr @Buffer1, i32 10, i32 9, i1 true, i32 -1, i32 0} +// CHECK-DAG: ![[Array]] = !{ptr @BufferArray, i32 10, i32 9, i1 true, i32 -1, i32 0} +// CHECK-DAG: ![[SingleAllocated]] = !{ptr @Buffer2, i32 10, i32 9, i1 true, i32 3, i32 0} +// CHECK-DAG: ![[ArrayAllocated]] = !{ptr @BufferArray2, i32 10, i32 9, i1 true, i32 4, i32 0} +// CHECK-DAG: ![[SingleSpace]] = !{ptr @Buffer3, i32 10, i32 9, i1 true, i32 3, i32 1} +// CHECK-DAG: ![[ArraySpace]] = !{ptr @BufferArray3, i32 10, i32 9, i1 true, i32 4, i32 1} diff --git a/clang/test/CodeGenHLSL/builtins/StructuredBuffer-annotations.hlsl b/clang/test/CodeGenHLSL/builtins/StructuredBuffer-annotations.hlsl index 16b7295c985f7..4d3d4908c396e 100644 --- a/clang/test/CodeGenHLSL/builtins/StructuredBuffer-annotations.hlsl +++ b/clang/test/CodeGenHLSL/builtins/StructuredBuffer-annotations.hlsl @@ -14,9 +14,9 @@ void main() { } // CHECK: !hlsl.uavs = !{![[Single:[0-9]+]], ![[Array:[0-9]+]], ![[SingleAllocated:[0-9]+]], ![[ArrayAllocated:[0-9]+]], ![[SingleSpace:[0-9]+]], ![[ArraySpace:[0-9]+]]} -// CHECK-DAG: ![[Single]] = !{ptr @"?Buffer1@@3V?$StructuredBuffer@M@hlsl@@A", i32 10, i32 9, i1 false, i32 -1, i32 0} -// CHECK-DAG: ![[Array]] = !{ptr @"?BufferArray@@3PAV?$StructuredBuffer@T?$__vector@M$03@__clang@@@hlsl@@A", i32 10, i32 9, i1 false, i32 -1, i32 0} -// CHECK-DAG: ![[SingleAllocated]] = !{ptr @"?Buffer2@@3V?$StructuredBuffer@M@hlsl@@A", i32 10, i32 9, i1 false, i32 3, i32 0} -// CHECK-DAG: ![[ArrayAllocated]] = !{ptr @"?BufferArray2@@3PAV?$StructuredBuffer@T?$__vector@M$03@__clang@@@hlsl@@A", i32 10, i32 9, i1 false, i32 4, i32 0} -// CHECK-DAG: ![[SingleSpace]] = !{ptr @"?Buffer3@@3V?$StructuredBuffer@M@hlsl@@A", i32 10, i32 9, i1 false, i32 3, i32 1} -// CHECK-DAG: ![[ArraySpace]] = !{ptr @"?BufferArray3@@3PAV?$StructuredBuffer@T?$__vector@M$03@__clang@@@hlsl@@A", i32 10, i32 9, i1 false, i32 4, i32 1} +// CHECK-DAG: ![[Single]] = !{ptr @Buffer1, i32 10, i32 9, i1 false, i32 -1, i32 0} +// CHECK-DAG: ![[Array]] = !{ptr @BufferArray, i32 10, i32 9, i1 false, i32 -1, i32 0} +// CHECK-DAG: ![[SingleAllocated]] = !{ptr @Buffer2, i32 10, i32 9, i1 false, i32 3, i32 0} +// CHECK-DAG: ![[ArrayAllocated]] = !{ptr @BufferArray2, i32 10, i32 9, i1 false, i32 4, i32 0} +// CHECK-DAG: ![[SingleSpace]] = !{ptr @Buffer3, i32 10, i32 9, i1 false, i32 3, i32 1} +// CHECK-DAG: ![[ArraySpace]] = !{ptr @BufferArray3, i32 10, i32 9, i1 false, i32 4, i32 1} diff --git a/clang/test/CodeGenHLSL/builtins/StructuredBuffer-elementtype.hlsl b/clang/test/CodeGenHLSL/builtins/StructuredBuffer-elementtype.hlsl index 8ddf8a6004403..326885efbeeab 100644 --- a/clang/test/CodeGenHLSL/builtins/StructuredBuffer-elementtype.hlsl +++ b/clang/test/CodeGenHLSL/builtins/StructuredBuffer-elementtype.hlsl @@ -37,16 +37,16 @@ void main(int GI : SV_GroupIndex) { BufF32x3[GI] = 0; } -// CHECK: !{{[0-9]+}} = !{ptr @"?BufI16@@3V?$StructuredBuffer@F@hlsl@@A", i32 10, i32 2, -// CHECK: !{{[0-9]+}} = !{ptr @"?BufU16@@3V?$StructuredBuffer@G@hlsl@@A", i32 10, i32 3, -// CHECK: !{{[0-9]+}} = !{ptr @"?BufI32@@3V?$StructuredBuffer@H@hlsl@@A", i32 10, i32 4, -// CHECK: !{{[0-9]+}} = !{ptr @"?BufU32@@3V?$StructuredBuffer@I@hlsl@@A", i32 10, i32 5, -// CHECK: !{{[0-9]+}} = !{ptr @"?BufI64@@3V?$StructuredBuffer@J@hlsl@@A", i32 10, i32 6, -// CHECK: !{{[0-9]+}} = !{ptr @"?BufU64@@3V?$StructuredBuffer@K@hlsl@@A", i32 10, i32 7, -// CHECK: !{{[0-9]+}} = !{ptr @"?BufF16@@3V?$StructuredBuffer@$f16@@hlsl@@A", i32 10, i32 8, -// CHECK: !{{[0-9]+}} = !{ptr @"?BufF32@@3V?$StructuredBuffer@M@hlsl@@A", i32 10, i32 9, -// CHECK: !{{[0-9]+}} = !{ptr @"?BufF64@@3V?$StructuredBuffer@N@hlsl@@A", i32 10, i32 10, -// CHECK: !{{[0-9]+}} = !{ptr @"?BufI16x4@@3V?$StructuredBuffer@T?$__vector@F$03@__clang@@@hlsl@@A", i32 10, i32 2, -// CHECK: !{{[0-9]+}} = !{ptr @"?BufU32x3@@3V?$StructuredBuffer@T?$__vector@I$02@__clang@@@hlsl@@A", i32 10, i32 5, -// CHECK: !{{[0-9]+}} = !{ptr @"?BufF16x2@@3V?$StructuredBuffer@T?$__vector@$f16@$01@__clang@@@hlsl@@A", i32 10, i32 8, -// CHECK: !{{[0-9]+}} = !{ptr @"?BufF32x3@@3V?$StructuredBuffer@T?$__vector@M$02@__clang@@@hlsl@@A", i32 10, i32 9, +// CHECK: !{{[0-9]+}} = !{ptr @BufI16, i32 10, i32 2, +// CHECK: !{{[0-9]+}} = !{ptr @BufU16, i32 10, i32 3, +// CHECK: !{{[0-9]+}} = !{ptr @BufI32, i32 10, i32 4, +// CHECK: !{{[0-9]+}} = !{ptr @BufU32, i32 10, i32 5, +// CHECK: !{{[0-9]+}} = !{ptr @BufI64, i32 10, i32 6, +// CHECK: !{{[0-9]+}} = !{ptr @BufU64, i32 10, i32 7, +// CHECK: !{{[0-9]+}} = !{ptr @BufF16, i32 10, i32 8, +// CHECK: !{{[0-9]+}} = !{ptr @BufF32, i32 10, i32 9, +// CHECK: !{{[0-9]+}} = !{ptr @BufF64, i32 10, i32 10, +// CHECK: !{{[0-9]+}} = !{ptr @BufI16x4, i32 10, i32 2, +// CHECK: !{{[0-9]+}} = !{ptr @BufU32x3, i32 10, i32 5, +// CHECK: !{{[0-9]+}} = !{ptr @BufF16x2, i32 10, i32 8, +// CHECK: !{{[0-9]+}} = !{ptr @BufF32x3, i32 10, i32 9, diff --git a/clang/test/CodeGenHLSL/builtins/abs.hlsl b/clang/test/CodeGenHLSL/builtins/abs.hlsl index ad65cab2721a2..912e8a2834723 100644 --- a/clang/test/CodeGenHLSL/builtins/abs.hlsl +++ b/clang/test/CodeGenHLSL/builtins/abs.hlsl @@ -1,93 +1,96 @@ -// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple \ -// RUN: dxil-pc-shadermodel6.3-library %s -fnative-half-type \ -// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s \ -// RUN: --check-prefixes=CHECK,NATIVE_HALF -// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple \ -// RUN: dxil-pc-shadermodel6.3-library %s -emit-llvm -disable-llvm-passes \ -// RUN: -o - | FileCheck %s --check-prefixes=CHECK,NO_HALF +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \ +// RUN: -fnative-half-type -emit-llvm -disable-llvm-passes -o - | \ +// RUN: FileCheck %s --check-prefixes=CHECK,NATIVE_HALF +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \ +// RUN: -emit-llvm -disable-llvm-passes -o - | \ +// RUN: FileCheck %s --check-prefixes=CHECK,NO_HALF using hlsl::abs; #ifdef __HLSL_ENABLE_16_BIT -// NATIVE_HALF: define noundef i16 @ +// NATIVE_HALF-LABEL: define noundef i16 @_Z16test_abs_int16_t // NATIVE_HALF: call i16 @llvm.abs.i16( int16_t test_abs_int16_t(int16_t p0) { return abs(p0); } -// NATIVE_HALF: define noundef <2 x i16> @ +// NATIVE_HALF-LABEL: define noundef <2 x i16> @_Z17test_abs_int16_t2 // NATIVE_HALF: call <2 x i16> @llvm.abs.v2i16( int16_t2 test_abs_int16_t2(int16_t2 p0) { return abs(p0); } -// NATIVE_HALF: define noundef <3 x i16> @ +// NATIVE_HALF-LABEL: define noundef <3 x i16> @_Z17test_abs_int16_t3 // NATIVE_HALF: call <3 x i16> @llvm.abs.v3i16( int16_t3 test_abs_int16_t3(int16_t3 p0) { return abs(p0); } -// NATIVE_HALF: define noundef <4 x i16> @ +// NATIVE_HALF-LABEL: define noundef <4 x i16> @_Z17test_abs_int16_t4 // NATIVE_HALF: call <4 x i16> @llvm.abs.v4i16( int16_t4 test_abs_int16_t4(int16_t4 p0) { return abs(p0); } #endif // __HLSL_ENABLE_16_BIT -// NATIVE_HALF: define noundef half @ +// NATIVE_HALF-LABEL: define noundef half @_Z13test_abs_half // NATIVE_HALF: call half @llvm.fabs.f16( -// NO_HALF: define noundef float @"?test_abs_half@@YA$halff@$halff@@Z"( +// NO_HALF-LABEL: define noundef float @_Z13test_abs_half // NO_HALF: call float @llvm.fabs.f32(float %0) half test_abs_half(half p0) { return abs(p0); } -// NATIVE_HALF: define noundef <2 x half> @ +// NATIVE_HALF-LABEL: define noundef <2 x half> @_Z14test_abs_half2 // NATIVE_HALF: call <2 x half> @llvm.fabs.v2f16( -// NO_HALF: define noundef <2 x float> @"?test_abs_half2@@YAT?$__vector@$halff@$01@__clang@@T12@@Z"( +// NO_HALF-LABEL: define noundef <2 x float> @_Z14test_abs_half2 // NO_HALF: call <2 x float> @llvm.fabs.v2f32( half2 test_abs_half2(half2 p0) { return abs(p0); } -// NATIVE_HALF: define noundef <3 x half> @ +// NATIVE_HALF-LABEL: define noundef <3 x half> @_Z14test_abs_half3 // NATIVE_HALF: call <3 x half> @llvm.fabs.v3f16( -// NO_HALF: define noundef <3 x float> @"?test_abs_half3@@YAT?$__vector@$halff@$02@__clang@@T12@@Z"( +// NO_HALF-LABEL: define noundef <3 x float> @_Z14test_abs_half3 // NO_HALF: call <3 x float> @llvm.fabs.v3f32( half3 test_abs_half3(half3 p0) { return abs(p0); } -// NATIVE_HALF: define noundef <4 x half> @ +// NATIVE_HALF-LABEL: define noundef <4 x half> @_Z14test_abs_half4 // NATIVE_HALF: call <4 x half> @llvm.fabs.v4f16( -// NO_HALF: define noundef <4 x float> @"?test_abs_half4@@YAT?$__vector@$halff@$03@__clang@@T12@@Z"( +// NO_HALF-LABEL: define noundef <4 x float> @_Z14test_abs_half4 // NO_HALF: call <4 x float> @llvm.fabs.v4f32( half4 test_abs_half4(half4 p0) { return abs(p0); } -// CHECK: define noundef i32 @ + +// CHECK-LABEL: define noundef i32 @_Z12test_abs_int // CHECK: call i32 @llvm.abs.i32( int test_abs_int(int p0) { return abs(p0); } -// CHECK: define noundef <2 x i32> @ +// CHECK-LABEL: define noundef <2 x i32> @_Z13test_abs_int2 // CHECK: call <2 x i32> @llvm.abs.v2i32( int2 test_abs_int2(int2 p0) { return abs(p0); } -// CHECK: define noundef <3 x i32> @ +// CHECK-LABEL: define noundef <3 x i32> @_Z13test_abs_int3 // CHECK: call <3 x i32> @llvm.abs.v3i32( int3 test_abs_int3(int3 p0) { return abs(p0); } -// CHECK: define noundef <4 x i32> @ +// CHECK-LABEL: define noundef <4 x i32> @_Z13test_abs_int4 // CHECK: call <4 x i32> @llvm.abs.v4i32( int4 test_abs_int4(int4 p0) { return abs(p0); } -// CHECK: define noundef float @ + +// CHECK-LABEL: define noundef float @_Z14test_abs_float // CHECK: call float @llvm.fabs.f32( float test_abs_float(float p0) { return abs(p0); } -// CHECK: define noundef <2 x float> @ +// CHECK-LABEL: define noundef <2 x float> @_Z15test_abs_float2 // CHECK: call <2 x float> @llvm.fabs.v2f32( float2 test_abs_float2(float2 p0) { return abs(p0); } -// CHECK: define noundef <3 x float> @ +// CHECK-LABEL: define noundef <3 x float> @_Z15test_abs_float3 // CHECK: call <3 x float> @llvm.fabs.v3f32( float3 test_abs_float3(float3 p0) { return abs(p0); } -// CHECK: define noundef <4 x float> @ +// CHECK-LABEL: define noundef <4 x float> @_Z15test_abs_float4 // CHECK: call <4 x float> @llvm.fabs.v4f32( float4 test_abs_float4(float4 p0) { return abs(p0); } -// CHECK: define noundef i64 @ + +// CHECK-LABEL: define noundef i64 @_Z16test_abs_int64_t // CHECK: call i64 @llvm.abs.i64( int64_t test_abs_int64_t(int64_t p0) { return abs(p0); } -// CHECK: define noundef <2 x i64> @ +// CHECK-LABEL: define noundef <2 x i64> @_Z17test_abs_int64_t2 // CHECK: call <2 x i64> @llvm.abs.v2i64( int64_t2 test_abs_int64_t2(int64_t2 p0) { return abs(p0); } -// CHECK: define noundef <3 x i64> @ +// CHECK-LABEL: define noundef <3 x i64> @_Z17test_abs_int64_t3 // CHECK: call <3 x i64> @llvm.abs.v3i64( int64_t3 test_abs_int64_t3(int64_t3 p0) { return abs(p0); } -// CHECK: define noundef <4 x i64> @ +// CHECK-LABEL: define noundef <4 x i64> @_Z17test_abs_int64_t4 // CHECK: call <4 x i64> @llvm.abs.v4i64( int64_t4 test_abs_int64_t4(int64_t4 p0) { return abs(p0); } -// CHECK: define noundef double @ + +// CHECK-LABEL: define noundef double @_Z15test_abs_double // CHECK: call double @llvm.fabs.f64( double test_abs_double(double p0) { return abs(p0); } -// CHECK: define noundef <2 x double> @ +// CHECK-LABEL: define noundef <2 x double> @_Z16test_abs_double2 // CHECK: call <2 x double> @llvm.fabs.v2f64( double2 test_abs_double2(double2 p0) { return abs(p0); } -// CHECK: define noundef <3 x double> @ +// CHECK-LABEL: define noundef <3 x double> @_Z16test_abs_double3 // CHECK: call <3 x double> @llvm.fabs.v3f64( double3 test_abs_double3(double3 p0) { return abs(p0); } -// CHECK: define noundef <4 x double> @ +// CHECK-LABEL: define noundef <4 x double> @_Z16test_abs_double4 // CHECK: call <4 x double> @llvm.fabs.v4f64( double4 test_abs_double4(double4 p0) { return abs(p0); } diff --git a/clang/test/CodeGenHLSL/builtins/ceil.hlsl b/clang/test/CodeGenHLSL/builtins/ceil.hlsl index be7725cd4d66c..3aa78ec0ebcca 100644 --- a/clang/test/CodeGenHLSL/builtins/ceil.hlsl +++ b/clang/test/CodeGenHLSL/builtins/ceil.hlsl @@ -1,43 +1,42 @@ -// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple \ -// RUN: dxil-pc-shadermodel6.3-library %s -fnative-half-type \ -// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s \ -// RUN: --check-prefixes=CHECK,NATIVE_HALF -// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple \ -// RUN: dxil-pc-shadermodel6.3-library %s -emit-llvm -disable-llvm-passes \ -// RUN: -o - | FileCheck %s --check-prefixes=CHECK,NO_HALF +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \ +// RUN: -fnative-half-type -emit-llvm -disable-llvm-passes -o - | \ +// RUN: FileCheck %s --check-prefixes=CHECK,NATIVE_HALF +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \ +// RUN: -emit-llvm -disable-llvm-passes -o - | \ +// RUN: FileCheck %s --check-prefixes=CHECK,NO_HALF using hlsl::ceil; -// NATIVE_HALF: define noundef half @ +// NATIVE_HALF-LABEL: define noundef half @_Z14test_ceil_half // NATIVE_HALF: call half @llvm.ceil.f16( -// NO_HALF: define noundef float @"?test_ceil_half@@YA$halff@$halff@@Z"( +// NO_HALF-LABEL: define noundef float @_Z14test_ceil_half // NO_HALF: call float @llvm.ceil.f32(float %0) half test_ceil_half(half p0) { return ceil(p0); } -// NATIVE_HALF: define noundef <2 x half> @ +// NATIVE_HALF-LABEL: define noundef <2 x half> @_Z15test_ceil_half2 // NATIVE_HALF: call <2 x half> @llvm.ceil.v2f16( -// NO_HALF: define noundef <2 x float> @"?test_ceil_half2@@YAT?$__vector@$halff@$01@__clang@@T12@@Z"( +// NO_HALF-LABEL: define noundef <2 x float> @_Z15test_ceil_half2 // NO_HALF: call <2 x float> @llvm.ceil.v2f32( half2 test_ceil_half2(half2 p0) { return ceil(p0); } -// NATIVE_HALF: define noundef <3 x half> @ +// NATIVE_HALF-LABEL: define noundef <3 x half> @_Z15test_ceil_half3 // NATIVE_HALF: call <3 x half> @llvm.ceil.v3f16( -// NO_HALF: define noundef <3 x float> @"?test_ceil_half3@@YAT?$__vector@$halff@$02@__clang@@T12@@Z"( +// NO_HALF-LABEL: define noundef <3 x float> @_Z15test_ceil_half3 // NO_HALF: call <3 x float> @llvm.ceil.v3f32( half3 test_ceil_half3(half3 p0) { return ceil(p0); } -// NATIVE_HALF: define noundef <4 x half> @ +// NATIVE_HALF-LABEL: define noundef <4 x half> @_Z15test_ceil_half4 // NATIVE_HALF: call <4 x half> @llvm.ceil.v4f16( -// NO_HALF: define noundef <4 x float> @"?test_ceil_half4@@YAT?$__vector@$halff@$03@__clang@@T12@@Z"( +// NO_HALF-LABEL: define noundef <4 x float> @_Z15test_ceil_half4 // NO_HALF: call <4 x float> @llvm.ceil.v4f32( half4 test_ceil_half4(half4 p0) { return ceil(p0); } -// CHECK: define noundef float @ +// CHECK-LABEL: define noundef float @_Z15test_ceil_float // CHECK: call float @llvm.ceil.f32( float test_ceil_float(float p0) { return ceil(p0); } -// CHECK: define noundef <2 x float> @ +// CHECK-LABEL: define noundef <2 x float> @_Z16test_ceil_float2 // CHECK: call <2 x float> @llvm.ceil.v2f32( float2 test_ceil_float2(float2 p0) { return ceil(p0); } -// CHECK: define noundef <3 x float> @ +// CHECK-LABEL: define noundef <3 x float> @_Z16test_ceil_float3 // CHECK: call <3 x float> @llvm.ceil.v3f32( float3 test_ceil_float3(float3 p0) { return ceil(p0); } -// CHECK: define noundef <4 x float> @ +// CHECK-LABEL: define noundef <4 x float> @_Z16test_ceil_float4 // CHECK: call <4 x float> @llvm.ceil.v4f32( float4 test_ceil_float4(float4 p0) { return ceil(p0); } diff --git a/clang/test/CodeGenHLSL/builtins/clamp.hlsl b/clang/test/CodeGenHLSL/builtins/clamp.hlsl index 186114581e9c1..af8f6b9733a07 100644 --- a/clang/test/CodeGenHLSL/builtins/clamp.hlsl +++ b/clang/test/CodeGenHLSL/builtins/clamp.hlsl @@ -1,134 +1,133 @@ -// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple \ -// RUN: dxil-pc-shadermodel6.3-library %s -fnative-half-type \ -// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s \ -// RUN: --check-prefixes=CHECK,NATIVE_HALF -// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple \ -// RUN: dxil-pc-shadermodel6.3-library %s -emit-llvm -disable-llvm-passes \ -// RUN: -o - | FileCheck %s --check-prefixes=CHECK,NO_HALF +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \ +// RUN: -fnative-half-type -emit-llvm -disable-llvm-passes -o - | \ +// RUN: FileCheck %s --check-prefixes=CHECK,NATIVE_HALF +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \ +// RUN: -emit-llvm -disable-llvm-passes -o - | \ +// RUN: FileCheck %s --check-prefixes=CHECK,NO_HALF #ifdef __HLSL_ENABLE_16_BIT -// NATIVE_HALF: define noundef i16 @ +// NATIVE_HALF-LABEL: define noundef i16 @_Z16test_clamp_short // NATIVE_HALF: call i16 @llvm.dx.clamp.i16( int16_t test_clamp_short(int16_t p0, int16_t p1) { return clamp(p0, p1,p1); } -// NATIVE_HALF: define noundef <2 x i16> @ +// NATIVE_HALF-LABEL: define noundef <2 x i16> @_Z17test_clamp_short2 // NATIVE_HALF: call <2 x i16> @llvm.dx.clamp.v2i16( int16_t2 test_clamp_short2(int16_t2 p0, int16_t2 p1) { return clamp(p0, p1,p1); } -// NATIVE_HALF: define noundef <3 x i16> @ +// NATIVE_HALF-LABEL: define noundef <3 x i16> @_Z17test_clamp_short3 // NATIVE_HALF: call <3 x i16> @llvm.dx.clamp.v3i16 int16_t3 test_clamp_short3(int16_t3 p0, int16_t3 p1) { return clamp(p0, p1,p1); } -// NATIVE_HALF: define noundef <4 x i16> @ +// NATIVE_HALF-LABEL: define noundef <4 x i16> @_Z17test_clamp_short4 // NATIVE_HALF: call <4 x i16> @llvm.dx.clamp.v4i16 int16_t4 test_clamp_short4(int16_t4 p0, int16_t4 p1) { return clamp(p0, p1,p1); } -// NATIVE_HALF: define noundef i16 @ +// NATIVE_HALF-LABEL: define noundef i16 @_Z17test_clamp_ushort // NATIVE_HALF: call i16 @llvm.dx.uclamp.i16( uint16_t test_clamp_ushort(uint16_t p0, uint16_t p1) { return clamp(p0, p1,p1); } -// NATIVE_HALF: define noundef <2 x i16> @ +// NATIVE_HALF-LABEL: define noundef <2 x i16> @_Z18test_clamp_ushort2 // NATIVE_HALF: call <2 x i16> @llvm.dx.uclamp.v2i16 uint16_t2 test_clamp_ushort2(uint16_t2 p0, uint16_t2 p1) { return clamp(p0, p1,p1); } -// NATIVE_HALF: define noundef <3 x i16> @ +// NATIVE_HALF-LABEL: define noundef <3 x i16> @_Z18test_clamp_ushort3 // NATIVE_HALF: call <3 x i16> @llvm.dx.uclamp.v3i16 uint16_t3 test_clamp_ushort3(uint16_t3 p0, uint16_t3 p1) { return clamp(p0, p1,p1); } -// NATIVE_HALF: define noundef <4 x i16> @ +// NATIVE_HALF-LABEL: define noundef <4 x i16> @_Z18test_clamp_ushort4 // NATIVE_HALF: call <4 x i16> @llvm.dx.uclamp.v4i16 uint16_t4 test_clamp_ushort4(uint16_t4 p0, uint16_t4 p1) { return clamp(p0, p1,p1); } #endif -// CHECK: define noundef i32 @ +// CHECK-LABEL: define noundef i32 @_Z14test_clamp_int // CHECK: call i32 @llvm.dx.clamp.i32( int test_clamp_int(int p0, int p1) { return clamp(p0, p1,p1); } -// CHECK: define noundef <2 x i32> @ +// CHECK-LABEL: define noundef <2 x i32> @_Z15test_clamp_int2 // CHECK: call <2 x i32> @llvm.dx.clamp.v2i32 int2 test_clamp_int2(int2 p0, int2 p1) { return clamp(p0, p1,p1); } -// CHECK: define noundef <3 x i32> @ +// CHECK-LABEL: define noundef <3 x i32> @_Z15test_clamp_int3 // CHECK: call <3 x i32> @llvm.dx.clamp.v3i32 int3 test_clamp_int3(int3 p0, int3 p1) { return clamp(p0, p1,p1); } -// CHECK: define noundef <4 x i32> @ +// CHECK-LABEL: define noundef <4 x i32> @_Z15test_clamp_int4 // CHECK: call <4 x i32> @llvm.dx.clamp.v4i32 int4 test_clamp_int4(int4 p0, int4 p1) { return clamp(p0, p1,p1); } -// CHECK: define noundef i32 @ +// CHECK-LABEL: define noundef i32 @_Z15test_clamp_uint // CHECK: call i32 @llvm.dx.uclamp.i32( int test_clamp_uint(uint p0, uint p1) { return clamp(p0, p1,p1); } -// CHECK: define noundef <2 x i32> @ +// CHECK-LABEL: define noundef <2 x i32> @_Z16test_clamp_uint2 // CHECK: call <2 x i32> @llvm.dx.uclamp.v2i32 uint2 test_clamp_uint2(uint2 p0, uint2 p1) { return clamp(p0, p1,p1); } -// CHECK: define noundef <3 x i32> @ +// CHECK-LABEL: define noundef <3 x i32> @_Z16test_clamp_uint3 // CHECK: call <3 x i32> @llvm.dx.uclamp.v3i32 uint3 test_clamp_uint3(uint3 p0, uint3 p1) { return clamp(p0, p1,p1); } -// CHECK: define noundef <4 x i32> @ +// CHECK-LABEL: define noundef <4 x i32> @_Z16test_clamp_uint4 // CHECK: call <4 x i32> @llvm.dx.uclamp.v4i32 uint4 test_clamp_uint4(uint4 p0, uint4 p1) { return clamp(p0, p1,p1); } -// CHECK: define noundef i64 @ +// CHECK-LABEL: define noundef i64 @_Z15test_clamp_long // CHECK: call i64 @llvm.dx.clamp.i64( int64_t test_clamp_long(int64_t p0, int64_t p1) { return clamp(p0, p1,p1); } -// CHECK: define noundef <2 x i64> @ +// CHECK-LABEL: define noundef <2 x i64> @_Z16test_clamp_long2 // CHECK: call <2 x i64> @llvm.dx.clamp.v2i64 int64_t2 test_clamp_long2(int64_t2 p0, int64_t2 p1) { return clamp(p0, p1,p1); } -// CHECK: define noundef <3 x i64> @ +// CHECK-LABEL: define noundef <3 x i64> @_Z16test_clamp_long3 // CHECK: call <3 x i64> @llvm.dx.clamp.v3i64 int64_t3 test_clamp_long3(int64_t3 p0, int64_t3 p1) { return clamp(p0, p1,p1); } -// CHECK: define noundef <4 x i64> @ +// CHECK-LABEL: define noundef <4 x i64> @_Z16test_clamp_long4 // CHECK: call <4 x i64> @llvm.dx.clamp.v4i64 int64_t4 test_clamp_long4(int64_t4 p0, int64_t4 p1) { return clamp(p0, p1,p1); } -// CHECK: define noundef i64 @ +// CHECK-LABEL: define noundef i64 @_Z16test_clamp_ulong // CHECK: call i64 @llvm.dx.uclamp.i64( -uint64_t test_clamp_long(uint64_t p0, uint64_t p1) { return clamp(p0, p1,p1); } -// CHECK: define noundef <2 x i64> @ +uint64_t test_clamp_ulong(uint64_t p0, uint64_t p1) { return clamp(p0, p1,p1); } +// CHECK-LABEL: define noundef <2 x i64> @_Z17test_clamp_ulong2 // CHECK: call <2 x i64> @llvm.dx.uclamp.v2i64 -uint64_t2 test_clamp_long2(uint64_t2 p0, uint64_t2 p1) { return clamp(p0, p1,p1); } -// CHECK: define noundef <3 x i64> @ +uint64_t2 test_clamp_ulong2(uint64_t2 p0, uint64_t2 p1) { return clamp(p0, p1,p1); } +// CHECK-LABEL: define noundef <3 x i64> @_Z17test_clamp_ulong3 // CHECK: call <3 x i64> @llvm.dx.uclamp.v3i64 -uint64_t3 test_clamp_long3(uint64_t3 p0, uint64_t3 p1) { return clamp(p0, p1,p1); } -// CHECK: define noundef <4 x i64> @ +uint64_t3 test_clamp_ulong3(uint64_t3 p0, uint64_t3 p1) { return clamp(p0, p1,p1); } +// CHECK-LABEL: define noundef <4 x i64> @_Z17test_clamp_ulong4 // CHECK: call <4 x i64> @llvm.dx.uclamp.v4i64 -uint64_t4 test_clamp_long4(uint64_t4 p0, uint64_t4 p1) { return clamp(p0, p1,p1); } +uint64_t4 test_clamp_ulong4(uint64_t4 p0, uint64_t4 p1) { return clamp(p0, p1,p1); } -// NATIVE_HALF: define noundef half @ +// NATIVE_HALF-LABEL: define noundef half @_Z15test_clamp_half // NATIVE_HALF: call half @llvm.dx.clamp.f16( -// NO_HALF: define noundef float @"?test_clamp_half +// NO_HALF-LABEL: define noundef float @_Z15test_clamp_half // NO_HALF: call float @llvm.dx.clamp.f32( half test_clamp_half(half p0, half p1) { return clamp(p0, p1,p1); } -// NATIVE_HALF: define noundef <2 x half> @ +// NATIVE_HALF-LABEL: define noundef <2 x half> @_Z16test_clamp_half2 // NATIVE_HALF: call <2 x half> @llvm.dx.clamp.v2f16 -// NO_HALF: define noundef <2 x float> @"?test_clamp_half2 +// NO_HALF-LABEL: define noundef <2 x float> @_Z16test_clamp_half2 // NO_HALF: call <2 x float> @llvm.dx.clamp.v2f32( half2 test_clamp_half2(half2 p0, half2 p1) { return clamp(p0, p1,p1); } -// NATIVE_HALF: define noundef <3 x half> @ +// NATIVE_HALF-LABEL: define noundef <3 x half> @_Z16test_clamp_half3 // NATIVE_HALF: call <3 x half> @llvm.dx.clamp.v3f16 -// NO_HALF: define noundef <3 x float> @"?test_clamp_half3 +// NO_HALF-LABEL: define noundef <3 x float> @_Z16test_clamp_half3 // NO_HALF: call <3 x float> @llvm.dx.clamp.v3f32( half3 test_clamp_half3(half3 p0, half3 p1) { return clamp(p0, p1,p1); } -// NATIVE_HALF: define noundef <4 x half> @ +// NATIVE_HALF-LABEL: define noundef <4 x half> @_Z16test_clamp_half4 // NATIVE_HALF: call <4 x half> @llvm.dx.clamp.v4f16 -// NO_HALF: define noundef <4 x float> @"?test_clamp_half4 +// NO_HALF-LABEL: define noundef <4 x float> @_Z16test_clamp_half4 // NO_HALF: call <4 x float> @llvm.dx.clamp.v4f32( half4 test_clamp_half4(half4 p0, half4 p1) { return clamp(p0, p1,p1); } -// CHECK: define noundef float @"?test_clamp_float +// CHECK-LABEL: define noundef float @_Z16test_clamp_float // CHECK: call float @llvm.dx.clamp.f32( float test_clamp_float(float p0, float p1) { return clamp(p0, p1,p1); } -// CHECK: define noundef <2 x float> @"?test_clamp_float2 +// CHECK-LABEL: define noundef <2 x float> @_Z17test_clamp_float2 // CHECK: call <2 x float> @llvm.dx.clamp.v2f32 float2 test_clamp_float2(float2 p0, float2 p1) { return clamp(p0, p1,p1); } -// CHECK: define noundef <3 x float> @"?test_clamp_float3 +// CHECK-LABEL: define noundef <3 x float> @_Z17test_clamp_float3 // CHECK: call <3 x float> @llvm.dx.clamp.v3f32 float3 test_clamp_float3(float3 p0, float3 p1) { return clamp(p0, p1,p1); } -// CHECK: define noundef <4 x float> @"?test_clamp_float4 +// CHECK-LABEL: define noundef <4 x float> @_Z17test_clamp_float4 // CHECK: call <4 x float> @llvm.dx.clamp.v4f32 float4 test_clamp_float4(float4 p0, float4 p1) { return clamp(p0, p1,p1); } -// CHECK: define noundef double @ +// CHECK-LABEL: define noundef double @_Z17test_clamp_double // CHECK: call double @llvm.dx.clamp.f64( double test_clamp_double(double p0, double p1) { return clamp(p0, p1,p1); } -// CHECK: define noundef <2 x double> @ +// CHECK-LABEL: define noundef <2 x double> @_Z18test_clamp_double2 // CHECK: call <2 x double> @llvm.dx.clamp.v2f64 double2 test_clamp_double2(double2 p0, double2 p1) { return clamp(p0, p1,p1); } -// CHECK: define noundef <3 x double> @ +// CHECK-LABEL: define noundef <3 x double> @_Z18test_clamp_double3 // CHECK: call <3 x double> @llvm.dx.clamp.v3f64 double3 test_clamp_double3(double3 p0, double3 p1) { return clamp(p0, p1,p1); } -// CHECK: define noundef <4 x double> @ +// CHECK-LABEL: define noundef <4 x double> @_Z18test_clamp_double4 // CHECK: call <4 x double> @llvm.dx.clamp.v4f64 double4 test_clamp_double4(double4 p0, double4 p1) { return clamp(p0, p1,p1); } diff --git a/clang/test/CodeGenHLSL/builtins/cos.hlsl b/clang/test/CodeGenHLSL/builtins/cos.hlsl index 58b6309778813..4a41a9ec4a7ca 100644 --- a/clang/test/CodeGenHLSL/builtins/cos.hlsl +++ b/clang/test/CodeGenHLSL/builtins/cos.hlsl @@ -1,41 +1,40 @@ -// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple \ -// RUN: dxil-pc-shadermodel6.3-library %s -fnative-half-type \ -// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s \ -// RUN: --check-prefixes=CHECK,NATIVE_HALF -// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple \ -// RUN: dxil-pc-shadermodel6.3-library %s -emit-llvm -disable-llvm-passes \ -// RUN: -o - | FileCheck %s --check-prefixes=CHECK,NO_HALF +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \ +// RUN: -fnative-half-type -emit-llvm -disable-llvm-passes -o - | \ +// RUN: FileCheck %s --check-prefixes=CHECK,NATIVE_HALF +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \ +// RUN: -emit-llvm -disable-llvm-passes -o - | \ +// RUN: FileCheck %s --check-prefixes=CHECK,NO_HALF -// NATIVE_HALF: define noundef half @ +// NATIVE_HALF-LABEL: define noundef half @_Z13test_cos_half // NATIVE_HALF: call half @llvm.cos.f16( -// NO_HALF: define noundef float @"?test_cos_half +// NO_HALF-LABEL: define noundef float @_Z13test_cos_half // NO_HALF: call float @llvm.cos.f32( half test_cos_half(half p0) { return cos(p0); } -// NATIVE_HALF: define noundef <2 x half> @ +// NATIVE_HALF-LABEL: define noundef <2 x half> @_Z14test_cos_half2 // NATIVE_HALF: call <2 x half> @llvm.cos.v2f16 -// NO_HALF: define noundef <2 x float> @"?test_cos_half2 +// NO_HALF-LABEL: define noundef <2 x float> @_Z14test_cos_half2 // NO_HALF: call <2 x float> @llvm.cos.v2f32( half2 test_cos_half2(half2 p0) { return cos(p0); } -// NATIVE_HALF: define noundef <3 x half> @ +// NATIVE_HALF-LABEL: define noundef <3 x half> @_Z14test_cos_half3 // NATIVE_HALF: call <3 x half> @llvm.cos.v3f16 -// NO_HALF: define noundef <3 x float> @"?test_cos_half3 +// NO_HALF-LABEL: define noundef <3 x float> @_Z14test_cos_half3 // NO_HALF: call <3 x float> @llvm.cos.v3f32( half3 test_cos_half3(half3 p0) { return cos(p0); } -// NATIVE_HALF: define noundef <4 x half> @ +// NATIVE_HALF-LABEL: define noundef <4 x half> @_Z14test_cos_half4 // NATIVE_HALF: call <4 x half> @llvm.cos.v4f16 -// NO_HALF: define noundef <4 x float> @"?test_cos_half4 +// NO_HALF-LABEL: define noundef <4 x float> @_Z14test_cos_half4 // NO_HALF: call <4 x float> @llvm.cos.v4f32( half4 test_cos_half4(half4 p0) { return cos(p0); } -// CHECK: define noundef float @"?test_cos_float +// CHECK-LABEL: define noundef float @_Z14test_cos_float // CHECK: call float @llvm.cos.f32( float test_cos_float(float p0) { return cos(p0); } -// CHECK: define noundef <2 x float> @"?test_cos_float2 +// CHECK-LABEL: define noundef <2 x float> @_Z15test_cos_float2 // CHECK: call <2 x float> @llvm.cos.v2f32 float2 test_cos_float2(float2 p0) { return cos(p0); } -// CHECK: define noundef <3 x float> @"?test_cos_float3 +// CHECK-LABEL: define noundef <3 x float> @_Z15test_cos_float3 // CHECK: call <3 x float> @llvm.cos.v3f32 float3 test_cos_float3(float3 p0) { return cos(p0); } -// CHECK: define noundef <4 x float> @"?test_cos_float4 +// CHECK-LABEL: define noundef <4 x float> @_Z15test_cos_float4 // CHECK: call <4 x float> @llvm.cos.v4f32 float4 test_cos_float4(float4 p0) { return cos(p0); } diff --git a/clang/test/CodeGenHLSL/builtins/exp.hlsl b/clang/test/CodeGenHLSL/builtins/exp.hlsl index 773edbe3364fd..3445cfd2e71f6 100644 --- a/clang/test/CodeGenHLSL/builtins/exp.hlsl +++ b/clang/test/CodeGenHLSL/builtins/exp.hlsl @@ -1,53 +1,52 @@ -// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \ -// RUN: dxil-pc-shadermodel6.3-library %s -fnative-half-type \ -// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s \ -// RUN: --check-prefixes=CHECK,NATIVE_HALF -// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \ -// RUN: dxil-pc-shadermodel6.3-library %s -emit-llvm -disable-llvm-passes \ -// RUN: -o - | FileCheck %s --check-prefixes=CHECK,NO_HALF +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \ +// RUN: -fnative-half-type -emit-llvm -disable-llvm-passes -o - | \ +// RUN: FileCheck %s --check-prefixes=CHECK,NATIVE_HALF +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \ +// RUN: -emit-llvm -disable-llvm-passes -o - | \ +// RUN: FileCheck %s --check-prefixes=CHECK,NO_HALF -// NATIVE_HALF: define noundef half @ +// NATIVE_HALF-LABEL: define noundef half @_Z13test_exp_half // NATIVE_HALF: %elt.exp = call half @llvm.exp.f16( // NATIVE_HALF: ret half %elt.exp -// NO_HALF: define noundef float @"?test_exp_half@@YA$halff@$halff@@Z"( +// NO_HALF-LABEL: define noundef float @_Z13test_exp_half // NO_HALF: %elt.exp = call float @llvm.exp.f32( // NO_HALF: ret float %elt.exp half test_exp_half(half p0) { return exp(p0); } -// NATIVE_HALF: define noundef <2 x half> @ +// NATIVE_HALF-LABEL: define noundef <2 x half> @_Z14test_exp_half2 // NATIVE_HALF: %elt.exp = call <2 x half> @llvm.exp.v2f16 // NATIVE_HALF: ret <2 x half> %elt.exp -// NO_HALF: define noundef <2 x float> @ +// NO_HALF-LABEL: define noundef <2 x float> @_Z14test_exp_half2 // NO_HALF: %elt.exp = call <2 x float> @llvm.exp.v2f32( // NO_HALF: ret <2 x float> %elt.exp half2 test_exp_half2(half2 p0) { return exp(p0); } -// NATIVE_HALF: define noundef <3 x half> @ +// NATIVE_HALF-LABEL: define noundef <3 x half> @_Z14test_exp_half3 // NATIVE_HALF: %elt.exp = call <3 x half> @llvm.exp.v3f16 // NATIVE_HALF: ret <3 x half> %elt.exp -// NO_HALF: define noundef <3 x float> @ +// NO_HALF-LABEL: define noundef <3 x float> @_Z14test_exp_half3 // NO_HALF: %elt.exp = call <3 x float> @llvm.exp.v3f32( // NO_HALF: ret <3 x float> %elt.exp half3 test_exp_half3(half3 p0) { return exp(p0); } -// NATIVE_HALF: define noundef <4 x half> @ +// NATIVE_HALF-LABEL: define noundef <4 x half> @_Z14test_exp_half4 // NATIVE_HALF: %elt.exp = call <4 x half> @llvm.exp.v4f16 // NATIVE_HALF: ret <4 x half> %elt.exp -// NO_HALF: define noundef <4 x float> @ +// NO_HALF-LABEL: define noundef <4 x float> @_Z14test_exp_half4 // NO_HALF: %elt.exp = call <4 x float> @llvm.exp.v4f32( // NO_HALF: ret <4 x float> %elt.exp half4 test_exp_half4(half4 p0) { return exp(p0); } -// CHECK: define noundef float @ +// CHECK-LABEL: define noundef float @_Z14test_exp_float // CHECK: %elt.exp = call float @llvm.exp.f32( // CHECK: ret float %elt.exp float test_exp_float(float p0) { return exp(p0); } -// CHECK: define noundef <2 x float> @ +// CHECK-LABEL: define noundef <2 x float> @_Z15test_exp_float2 // CHECK: %elt.exp = call <2 x float> @llvm.exp.v2f32 // CHECK: ret <2 x float> %elt.exp float2 test_exp_float2(float2 p0) { return exp(p0); } -// CHECK: define noundef <3 x float> @ +// CHECK-LABEL: define noundef <3 x float> @_Z15test_exp_float3 // CHECK: %elt.exp = call <3 x float> @llvm.exp.v3f32 // CHECK: ret <3 x float> %elt.exp float3 test_exp_float3(float3 p0) { return exp(p0); } -// CHECK: define noundef <4 x float> @ +// CHECK-LABEL: define noundef <4 x float> @_Z15test_exp_float4 // CHECK: %elt.exp = call <4 x float> @llvm.exp.v4f32 // CHECK: ret <4 x float> %elt.exp float4 test_exp_float4(float4 p0) { return exp(p0); } diff --git a/clang/test/CodeGenHLSL/builtins/exp2.hlsl b/clang/test/CodeGenHLSL/builtins/exp2.hlsl index f21cdd95774ab..7bfc897beee16 100644 --- a/clang/test/CodeGenHLSL/builtins/exp2.hlsl +++ b/clang/test/CodeGenHLSL/builtins/exp2.hlsl @@ -1,53 +1,52 @@ -// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \ -// RUN: dxil-pc-shadermodel6.3-library %s -fnative-half-type \ -// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s \ -// RUN: --check-prefixes=CHECK,NATIVE_HALF -// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \ -// RUN: dxil-pc-shadermodel6.3-library %s -emit-llvm -disable-llvm-passes \ -// RUN: -o - | FileCheck %s --check-prefixes=CHECK,NO_HALF +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \ +// RUN: -fnative-half-type -emit-llvm -disable-llvm-passes -o - | \ +// RUN: FileCheck %s --check-prefixes=CHECK,NATIVE_HALF +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \ +// RUN: -emit-llvm -disable-llvm-passes -o - | \ +// RUN: FileCheck %s --check-prefixes=CHECK,NO_HALF -// NATIVE_HALF: define noundef half @ +// NATIVE_HALF-LABEL: define noundef half @_Z14test_exp2_half // NATIVE_HALF: %elt.exp2 = call half @llvm.exp2.f16( // NATIVE_HALF: ret half %elt.exp2 -// NO_HALF: define noundef float @"?test_exp2_half@@YA$halff@$halff@@Z"( +// NO_HALF-LABEL: define noundef float @_Z14test_exp2_half // NO_HALF: %elt.exp2 = call float @llvm.exp2.f32( // NO_HALF: ret float %elt.exp2 half test_exp2_half(half p0) { return exp2(p0); } -// NATIVE_HALF: define noundef <2 x half> @ +// NATIVE_HALF-LABEL: define noundef <2 x half> @_Z15test_exp2_half2 // NATIVE_HALF: %elt.exp2 = call <2 x half> @llvm.exp2.v2f16 // NATIVE_HALF: ret <2 x half> %elt.exp2 -// NO_HALF: define noundef <2 x float> @ +// NO_HALF-LABEL: define noundef <2 x float> @_Z15test_exp2_half2 // NO_HALF: %elt.exp2 = call <2 x float> @llvm.exp2.v2f32( // NO_HALF: ret <2 x float> %elt.exp2 half2 test_exp2_half2(half2 p0) { return exp2(p0); } -// NATIVE_HALF: define noundef <3 x half> @ +// NATIVE_HALF-LABEL: define noundef <3 x half> @_Z15test_exp2_half3 // NATIVE_HALF: %elt.exp2 = call <3 x half> @llvm.exp2.v3f16 // NATIVE_HALF: ret <3 x half> %elt.exp2 -// NO_HALF: define noundef <3 x float> @ +// NO_HALF-LABEL: define noundef <3 x float> @_Z15test_exp2_half3 // NO_HALF: %elt.exp2 = call <3 x float> @llvm.exp2.v3f32( // NO_HALF: ret <3 x float> %elt.exp2 half3 test_exp2_half3(half3 p0) { return exp2(p0); } -// NATIVE_HALF: define noundef <4 x half> @ +// NATIVE_HALF-LABEL: define noundef <4 x half> @_Z15test_exp2_half4 // NATIVE_HALF: %elt.exp2 = call <4 x half> @llvm.exp2.v4f16 // NATIVE_HALF: ret <4 x half> %elt.exp2 -// NO_HALF: define noundef <4 x float> @ +// NO_HALF-LABEL: define noundef <4 x float> @_Z15test_exp2_half4 // NO_HALF: %elt.exp2 = call <4 x float> @llvm.exp2.v4f32( // NO_HALF: ret <4 x float> %elt.exp2 half4 test_exp2_half4(half4 p0) { return exp2(p0); } -// CHECK: define noundef float @ +// CHECK-LABEL: define noundef float @_Z15test_exp2_float // CHECK: %elt.exp2 = call float @llvm.exp2.f32( // CHECK: ret float %elt.exp2 float test_exp2_float(float p0) { return exp2(p0); } -// CHECK: define noundef <2 x float> @ +// CHECK-LABEL: define noundef <2 x float> @_Z16test_exp2_float2 // CHECK: %elt.exp2 = call <2 x float> @llvm.exp2.v2f32 // CHECK: ret <2 x float> %elt.exp2 float2 test_exp2_float2(float2 p0) { return exp2(p0); } -// CHECK: define noundef <3 x float> @ +// CHECK-LABEL: define noundef <3 x float> @_Z16test_exp2_float3 // CHECK: %elt.exp2 = call <3 x float> @llvm.exp2.v3f32 // CHECK: ret <3 x float> %elt.exp2 float3 test_exp2_float3(float3 p0) { return exp2(p0); } -// CHECK: define noundef <4 x float> @ +// CHECK-LABEL: define noundef <4 x float> @_Z16test_exp2_float4 // CHECK: %elt.exp2 = call <4 x float> @llvm.exp2.v4f32 // CHECK: ret <4 x float> %elt.exp2 float4 test_exp2_float4(float4 p0) { return exp2(p0); } diff --git a/clang/test/CodeGenHLSL/builtins/floor.hlsl b/clang/test/CodeGenHLSL/builtins/floor.hlsl index 48ddf713bcf50..c2d6f1bcc335c 100644 --- a/clang/test/CodeGenHLSL/builtins/floor.hlsl +++ b/clang/test/CodeGenHLSL/builtins/floor.hlsl @@ -1,43 +1,42 @@ -// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple \ -// RUN: dxil-pc-shadermodel6.3-library %s -fnative-half-type \ -// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s \ -// RUN: --check-prefixes=CHECK,NATIVE_HALF -// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple \ -// RUN: dxil-pc-shadermodel6.3-library %s -emit-llvm -disable-llvm-passes \ -// RUN: -o - | FileCheck %s --check-prefixes=CHECK,NO_HALF +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \ +// RUN: -fnative-half-type -emit-llvm -disable-llvm-passes -o - | \ +// RUN: FileCheck %s --check-prefixes=CHECK,NATIVE_HALF +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \ +// RUN: -emit-llvm -disable-llvm-passes -o - | \ +// RUN: FileCheck %s --check-prefixes=CHECK,NO_HALF using hlsl::floor; -// NATIVE_HALF: define noundef half @ +// NATIVE_HALF-LABEL: define noundef half @_Z15test_floor_half // NATIVE_HALF: call half @llvm.floor.f16( -// NO_HALF: define noundef float @"?test_floor_half@@YA$halff@$halff@@Z"( +// NO_HALF-LABEL: define noundef float @_Z15test_floor_half // NO_HALF: call float @llvm.floor.f32(float %0) half test_floor_half(half p0) { return floor(p0); } -// NATIVE_HALF: define noundef <2 x half> @ +// NATIVE_HALF-LABEL: define noundef <2 x half> @_Z16test_floor_half2 // NATIVE_HALF: call <2 x half> @llvm.floor.v2f16( -// NO_HALF: define noundef <2 x float> @"?test_floor_half2@@YAT?$__vector@$halff@$01@__clang@@T12@@Z"( +// NO_HALF-LABEL: define noundef <2 x float> @_Z16test_floor_half2 // NO_HALF: call <2 x float> @llvm.floor.v2f32( half2 test_floor_half2(half2 p0) { return floor(p0); } -// NATIVE_HALF: define noundef <3 x half> @ +// NATIVE_HALF-LABEL: define noundef <3 x half> @_Z16test_floor_half3 // NATIVE_HALF: call <3 x half> @llvm.floor.v3f16( -// NO_HALF: define noundef <3 x float> @"?test_floor_half3@@YAT?$__vector@$halff@$02@__clang@@T12@@Z"( +// NO_HALF-LABEL: define noundef <3 x float> @_Z16test_floor_half3 // NO_HALF: call <3 x float> @llvm.floor.v3f32( half3 test_floor_half3(half3 p0) { return floor(p0); } -// NATIVE_HALF: define noundef <4 x half> @ +// NATIVE_HALF-LABEL: define noundef <4 x half> @_Z16test_floor_half4 // NATIVE_HALF: call <4 x half> @llvm.floor.v4f16( -// NO_HALF: define noundef <4 x float> @"?test_floor_half4@@YAT?$__vector@$halff@$03@__clang@@T12@@Z"( +// NO_HALF-LABEL: define noundef <4 x float> @_Z16test_floor_half4 // NO_HALF: call <4 x float> @llvm.floor.v4f32( half4 test_floor_half4(half4 p0) { return floor(p0); } -// CHECK: define noundef float @ +// CHECK-LABEL: define noundef float @_Z16test_floor_float // CHECK: call float @llvm.floor.f32( float test_floor_float(float p0) { return floor(p0); } -// CHECK: define noundef <2 x float> @ +// CHECK-LABEL: define noundef <2 x float> @_Z17test_floor_float2 // CHECK: call <2 x float> @llvm.floor.v2f32( float2 test_floor_float2(float2 p0) { return floor(p0); } -// CHECK: define noundef <3 x float> @ +// CHECK-LABEL: define noundef <3 x float> @_Z17test_floor_float3 // CHECK: call <3 x float> @llvm.floor.v3f32( float3 test_floor_float3(float3 p0) { return floor(p0); } -// CHECK: define noundef <4 x float> @ +// CHECK-LABEL: define noundef <4 x float> @_Z17test_floor_float4 // CHECK: call <4 x float> @llvm.floor.v4f32( float4 test_floor_float4(float4 p0) { return floor(p0); } diff --git a/clang/test/CodeGenHLSL/builtins/hlsl_resource_t.hlsl b/clang/test/CodeGenHLSL/builtins/hlsl_resource_t.hlsl index ce97330903478..e735a85b589f8 100644 --- a/clang/test/CodeGenHLSL/builtins/hlsl_resource_t.hlsl +++ b/clang/test/CodeGenHLSL/builtins/hlsl_resource_t.hlsl @@ -2,8 +2,8 @@ void foo(__hlsl_resource_t res); -// CHECK: define void @"?bar@@YAXU__hlsl_resource_t@@@Z"(target("dx.TypedBuffer", <4 x float>, 1, 0, 0) %[[PARAM:[a-zA-Z0-9]+]]) -// CHECK: call void @"?foo@@YAXU__hlsl_resource_t@@@Z"(target("dx.TypedBuffer", <4 x float>, 1, 0, 0) %[[PARAM]]) +// CHECK: define void @_Z3baru17__hlsl_resource_t(target("dx.TypedBuffer", <4 x float>, 1, 0, 0) %[[PARAM:[a-zA-Z0-9]+]]) +// CHECK: call void @_Z3foou17__hlsl_resource_t(target("dx.TypedBuffer", <4 x float>, 1, 0, 0) %[[PARAM]]) void bar(__hlsl_resource_t a) { foo(a); } diff --git a/clang/test/CodeGenHLSL/builtins/log.hlsl b/clang/test/CodeGenHLSL/builtins/log.hlsl index c89eda683403b..71ce502eb8c4a 100644 --- a/clang/test/CodeGenHLSL/builtins/log.hlsl +++ b/clang/test/CodeGenHLSL/builtins/log.hlsl @@ -1,41 +1,40 @@ -// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple \ -// RUN: dxil-pc-shadermodel6.3-library %s -fnative-half-type \ -// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s \ -// RUN: --check-prefixes=CHECK,NATIVE_HALF -// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple \ -// RUN: dxil-pc-shadermodel6.3-library %s -emit-llvm -disable-llvm-passes \ -// RUN: -o - | FileCheck %s --check-prefixes=CHECK,NO_HALF +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \ +// RUN: -fnative-half-type -emit-llvm -disable-llvm-passes -o - | \ +// RUN: FileCheck %s --check-prefixes=CHECK,NATIVE_HALF +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \ +// RUN: -emit-llvm -disable-llvm-passes -o - | \ +// RUN: FileCheck %s --check-prefixes=CHECK,NO_HALF -// NATIVE_HALF: define noundef half @ +// NATIVE_HALF-LABEL: define noundef half @_Z13test_log_half // NATIVE_HALF: call half @llvm.log.f16( -// NO_HALF: define noundef float @"?test_log_half@@YA$halff@$halff@@Z"( +// NO_HALF-LABEL: define noundef float @_Z13test_log_half // NO_HALF: call float @llvm.log.f32( half test_log_half(half p0) { return log(p0); } -// NATIVE_HALF: define noundef <2 x half> @ +// NATIVE_HALF-LABEL: define noundef <2 x half> @_Z14test_log_half2 // NATIVE_HALF: call <2 x half> @llvm.log.v2f16 -// NO_HALF: define noundef <2 x float> @"?test_log_half2 +// NO_HALF-LABEL: define noundef <2 x float> @_Z14test_log_half2 // NO_HALF: call <2 x float> @llvm.log.v2f32( half2 test_log_half2(half2 p0) { return log(p0); } -// NATIVE_HALF: define noundef <3 x half> @ +// NATIVE_HALF-LABEL: define noundef <3 x half> @_Z14test_log_half3 // NATIVE_HALF: call <3 x half> @llvm.log.v3f16 -// NO_HALF: define noundef <3 x float> @"?test_log_half3 +// NO_HALF-LABEL: define noundef <3 x float> @_Z14test_log_half3 // NO_HALF: call <3 x float> @llvm.log.v3f32( half3 test_log_half3(half3 p0) { return log(p0); } -// NATIVE_HALF: define noundef <4 x half> @ +// NATIVE_HALF-LABEL: define noundef <4 x half> @_Z14test_log_half4 // NATIVE_HALF: call <4 x half> @llvm.log.v4f16 -// NO_HALF: define noundef <4 x float> @"?test_log_half4 +// NO_HALF-LABEL: define noundef <4 x float> @_Z14test_log_half4 // NO_HALF: call <4 x float> @llvm.log.v4f32( half4 test_log_half4(half4 p0) { return log(p0); } -// CHECK: define noundef float @"?test_log_float +// CHECK-LABEL: define noundef float @_Z14test_log_float // CHECK: call float @llvm.log.f32( float test_log_float(float p0) { return log(p0); } -// CHECK: define noundef <2 x float> @"?test_log_float2 +// CHECK-LABEL: define noundef <2 x float> @_Z15test_log_float2 // CHECK: call <2 x float> @llvm.log.v2f32 float2 test_log_float2(float2 p0) { return log(p0); } -// CHECK: define noundef <3 x float> @"?test_log_float3 +// CHECK-LABEL: define noundef <3 x float> @_Z15test_log_float3 // CHECK: call <3 x float> @llvm.log.v3f32 float3 test_log_float3(float3 p0) { return log(p0); } -// CHECK: define noundef <4 x float> @"?test_log_float4 +// CHECK-LABEL: define noundef <4 x float> @_Z15test_log_float4 // CHECK: call <4 x float> @llvm.log.v4f32 float4 test_log_float4(float4 p0) { return log(p0); } diff --git a/clang/test/CodeGenHLSL/builtins/log10.hlsl b/clang/test/CodeGenHLSL/builtins/log10.hlsl index 638b86e8d5eaf..e15b6f5747b0a 100644 --- a/clang/test/CodeGenHLSL/builtins/log10.hlsl +++ b/clang/test/CodeGenHLSL/builtins/log10.hlsl @@ -1,41 +1,40 @@ -// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple \ -// RUN: dxil-pc-shadermodel6.3-library %s -fnative-half-type \ -// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s \ -// RUN: --check-prefixes=CHECK,NATIVE_HALF -// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple \ -// RUN: dxil-pc-shadermodel6.3-library %s -emit-llvm -disable-llvm-passes \ -// RUN: -o - | FileCheck %s --check-prefixes=CHECK,NO_HALF +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \ +// RUN: -fnative-half-type -emit-llvm -disable-llvm-passes -o - | \ +// RUN: FileCheck %s --check-prefixes=CHECK,NATIVE_HALF +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \ +// RUN: -emit-llvm -disable-llvm-passes -o - | \ +// RUN: FileCheck %s --check-prefixes=CHECK,NO_HALF -// NATIVE_HALF: define noundef half @ +// NATIVE_HALF-LABEL: define noundef half @_Z15test_log10_half // NATIVE_HALF: call half @llvm.log10.f16( -// NO_HALF: define noundef float @"?test_log10_half +// NO_HALF-LABEL: define noundef float @_Z15test_log10_half // NO_HALF: call float @llvm.log10.f32( half test_log10_half(half p0) { return log10(p0); } -// NATIVE_HALF: define noundef <2 x half> @ +// NATIVE_HALF-LABEL: define noundef <2 x half> @_Z16test_log10_half2 // NATIVE_HALF: call <2 x half> @llvm.log10.v2f16 -// NO_HALF: define noundef <2 x float> @"?test_log10_half2 +// NO_HALF-LABEL: define noundef <2 x float> @_Z16test_log10_half2 // NO_HALF: call <2 x float> @llvm.log10.v2f32( half2 test_log10_half2(half2 p0) { return log10(p0); } -// NATIVE_HALF: define noundef <3 x half> @ +// NATIVE_HALF-LABEL: define noundef <3 x half> @_Z16test_log10_half3 // NATIVE_HALF: call <3 x half> @llvm.log10.v3f16 -// NO_HALF: define noundef <3 x float> @"?test_log10_half3 +// NO_HALF-LABEL: define noundef <3 x float> @_Z16test_log10_half3 // NO_HALF: call <3 x float> @llvm.log10.v3f32( half3 test_log10_half3(half3 p0) { return log10(p0); } -// NATIVE_HALF: define noundef <4 x half> @ +// NATIVE_HALF-LABEL: define noundef <4 x half> @_Z16test_log10_half4 // NATIVE_HALF: call <4 x half> @llvm.log10.v4f16 -// NO_HALF: define noundef <4 x float> @"?test_log10_half4 +// NO_HALF-LABEL: define noundef <4 x float> @_Z16test_log10_half4 // NO_HALF: call <4 x float> @llvm.log10.v4f32( half4 test_log10_half4(half4 p0) { return log10(p0); } -// CHECK: define noundef float @"?test_log10_float +// CHECK-LABEL: define noundef float @_Z16test_log10_float // CHECK: call float @llvm.log10.f32( float test_log10_float(float p0) { return log10(p0); } -// CHECK: define noundef <2 x float> @"?test_log10_float2 +// CHECK-LABEL: define noundef <2 x float> @_Z17test_log10_float2 // CHECK: call <2 x float> @llvm.log10.v2f32 float2 test_log10_float2(float2 p0) { return log10(p0); } -// CHECK: define noundef <3 x float> @"?test_log10_float3 +// CHECK-LABEL: define noundef <3 x float> @_Z17test_log10_float3 // CHECK: call <3 x float> @llvm.log10.v3f32 float3 test_log10_float3(float3 p0) { return log10(p0); } -// CHECK: define noundef <4 x float> @"?test_log10_float4 +// CHECK-LABEL: define noundef <4 x float> @_Z17test_log10_float4 // CHECK: call <4 x float> @llvm.log10.v4f32 float4 test_log10_float4(float4 p0) { return log10(p0); } diff --git a/clang/test/CodeGenHLSL/builtins/log2.hlsl b/clang/test/CodeGenHLSL/builtins/log2.hlsl index 31c7bff214c61..575761a5f637c 100644 --- a/clang/test/CodeGenHLSL/builtins/log2.hlsl +++ b/clang/test/CodeGenHLSL/builtins/log2.hlsl @@ -1,41 +1,40 @@ -// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple \ -// RUN: dxil-pc-shadermodel6.3-library %s -fnative-half-type \ -// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s \ -// RUN: --check-prefixes=CHECK,NATIVE_HALF -// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple \ -// RUN: dxil-pc-shadermodel6.3-library %s -emit-llvm -disable-llvm-passes \ -// RUN: -o - | FileCheck %s --check-prefixes=CHECK,NO_HALF +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \ +// RUN: -fnative-half-type -emit-llvm -disable-llvm-passes -o - | \ +// RUN: FileCheck %s --check-prefixes=CHECK,NATIVE_HALF +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \ +// RUN: -emit-llvm -disable-llvm-passes -o - | \ +// RUN: FileCheck %s --check-prefixes=CHECK,NO_HALF -// NATIVE_HALF: define noundef half @ +// NATIVE_HALF-LABEL: define noundef half @_Z14test_log2_half // NATIVE_HALF: call half @llvm.log2.f16( -// NO_HALF: define noundef float @"?test_log2_half +// NO_HALF-LABEL: define noundef float @_Z14test_log2_half // NO_HALF: call float @llvm.log2.f32( half test_log2_half(half p0) { return log2(p0); } -// NATIVE_HALF: define noundef <2 x half> @ +// NATIVE_HALF-LABEL: define noundef <2 x half> @_Z15test_log2_half2 // NATIVE_HALF: call <2 x half> @llvm.log2.v2f16 -// NO_HALF: define noundef <2 x float> @"?test_log2_half2 +// NO_HALF-LABEL: define noundef <2 x float> @_Z15test_log2_half2 // NO_HALF: call <2 x float> @llvm.log2.v2f32( half2 test_log2_half2(half2 p0) { return log2(p0); } -// NATIVE_HALF: define noundef <3 x half> @ +// NATIVE_HALF-LABEL: define noundef <3 x half> @_Z15test_log2_half3 // NATIVE_HALF: call <3 x half> @llvm.log2.v3f16 -// NO_HALF: define noundef <3 x float> @"?test_log2_half3 +// NO_HALF-LABEL: define noundef <3 x float> @_Z15test_log2_half3 // NO_HALF: call <3 x float> @llvm.log2.v3f32( half3 test_log2_half3(half3 p0) { return log2(p0); } -// NATIVE_HALF: define noundef <4 x half> @ +// NATIVE_HALF-LABEL: define noundef <4 x half> @_Z15test_log2_half4 // NATIVE_HALF: call <4 x half> @llvm.log2.v4f16 -// NO_HALF: define noundef <4 x float> @"?test_log2_half4 +// NO_HALF-LABEL: define noundef <4 x float> @_Z15test_log2_half4 // NO_HALF: call <4 x float> @llvm.log2.v4f32( half4 test_log2_half4(half4 p0) { return log2(p0); } -// CHECK: define noundef float @"?test_log2_float +// CHECK-LABEL: define noundef float @_Z15test_log2_float // CHECK: call float @llvm.log2.f32( float test_log2_float(float p0) { return log2(p0); } -// CHECK: define noundef <2 x float> @"?test_log2_float2 +// CHECK-LABEL: define noundef <2 x float> @_Z16test_log2_float2 // CHECK: call <2 x float> @llvm.log2.v2f32 float2 test_log2_float2(float2 p0) { return log2(p0); } -// CHECK: define noundef <3 x float> @"?test_log2_float3 +// CHECK-LABEL: define noundef <3 x float> @_Z16test_log2_float3 // CHECK: call <3 x float> @llvm.log2.v3f32 float3 test_log2_float3(float3 p0) { return log2(p0); } -// CHECK: define noundef <4 x float> @"?test_log2_float4 +// CHECK-LABEL: define noundef <4 x float> @_Z16test_log2_float4 // CHECK: call <4 x float> @llvm.log2.v4f32 float4 test_log2_float4(float4 p0) { return log2(p0); } diff --git a/clang/test/CodeGenHLSL/builtins/max.hlsl b/clang/test/CodeGenHLSL/builtins/max.hlsl index f17062f7bb011..d462fda2ccb09 100644 --- a/clang/test/CodeGenHLSL/builtins/max.hlsl +++ b/clang/test/CodeGenHLSL/builtins/max.hlsl @@ -1,134 +1,133 @@ -// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple \ -// RUN: dxil-pc-shadermodel6.3-library %s -fnative-half-type \ -// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s \ -// RUN: --check-prefixes=CHECK,NATIVE_HALF -// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple \ -// RUN: dxil-pc-shadermodel6.3-library %s -emit-llvm -disable-llvm-passes \ -// RUN: -o - | FileCheck %s --check-prefixes=CHECK,NO_HALF +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \ +// RUN: -fnative-half-type -emit-llvm -disable-llvm-passes -o - | \ +// RUN: FileCheck %s --check-prefixes=CHECK,NATIVE_HALF +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \ +// RUN: -emit-llvm -disable-llvm-passes -o - | \ +// RUN: FileCheck %s --check-prefixes=CHECK,NO_HALF #ifdef __HLSL_ENABLE_16_BIT -// NATIVE_HALF: define noundef i16 @ +// NATIVE_HALF-LABEL: define noundef i16 @_Z14test_max_short // NATIVE_HALF: call i16 @llvm.smax.i16( int16_t test_max_short(int16_t p0, int16_t p1) { return max(p0, p1); } -// NATIVE_HALF: define noundef <2 x i16> @ +// NATIVE_HALF-LABEL: define noundef <2 x i16> @_Z15test_max_short2 // NATIVE_HALF: call <2 x i16> @llvm.smax.v2i16( int16_t2 test_max_short2(int16_t2 p0, int16_t2 p1) { return max(p0, p1); } -// NATIVE_HALF: define noundef <3 x i16> @ +// NATIVE_HALF-LABEL: define noundef <3 x i16> @_Z15test_max_short3 // NATIVE_HALF: call <3 x i16> @llvm.smax.v3i16 int16_t3 test_max_short3(int16_t3 p0, int16_t3 p1) { return max(p0, p1); } -// NATIVE_HALF: define noundef <4 x i16> @ +// NATIVE_HALF-LABEL: define noundef <4 x i16> @_Z15test_max_short4 // NATIVE_HALF: call <4 x i16> @llvm.smax.v4i16 int16_t4 test_max_short4(int16_t4 p0, int16_t4 p1) { return max(p0, p1); } -// NATIVE_HALF: define noundef i16 @ +// NATIVE_HALF-LABEL: define noundef i16 @_Z15test_max_ushort // NATIVE_HALF: call i16 @llvm.umax.i16( uint16_t test_max_ushort(uint16_t p0, uint16_t p1) { return max(p0, p1); } -// NATIVE_HALF: define noundef <2 x i16> @ +// NATIVE_HALF-LABEL: define noundef <2 x i16> @_Z16test_max_ushort2 // NATIVE_HALF: call <2 x i16> @llvm.umax.v2i16 uint16_t2 test_max_ushort2(uint16_t2 p0, uint16_t2 p1) { return max(p0, p1); } -// NATIVE_HALF: define noundef <3 x i16> @ +// NATIVE_HALF-LABEL: define noundef <3 x i16> @_Z16test_max_ushort3 // NATIVE_HALF: call <3 x i16> @llvm.umax.v3i16 uint16_t3 test_max_ushort3(uint16_t3 p0, uint16_t3 p1) { return max(p0, p1); } -// NATIVE_HALF: define noundef <4 x i16> @ +// NATIVE_HALF-LABEL: define noundef <4 x i16> @_Z16test_max_ushort4 // NATIVE_HALF: call <4 x i16> @llvm.umax.v4i16 uint16_t4 test_max_ushort4(uint16_t4 p0, uint16_t4 p1) { return max(p0, p1); } #endif -// CHECK: define noundef i32 @ +// CHECK-LABEL: define noundef i32 @_Z12test_max_int // CHECK: call i32 @llvm.smax.i32( int test_max_int(int p0, int p1) { return max(p0, p1); } -// CHECK: define noundef <2 x i32> @ +// CHECK-LABEL: define noundef <2 x i32> @_Z13test_max_int2 // CHECK: call <2 x i32> @llvm.smax.v2i32 int2 test_max_int2(int2 p0, int2 p1) { return max(p0, p1); } -// CHECK: define noundef <3 x i32> @ +// CHECK-LABEL: define noundef <3 x i32> @_Z13test_max_int3 // CHECK: call <3 x i32> @llvm.smax.v3i32 int3 test_max_int3(int3 p0, int3 p1) { return max(p0, p1); } -// CHECK: define noundef <4 x i32> @ +// CHECK-LABEL: define noundef <4 x i32> @_Z13test_max_int4 // CHECK: call <4 x i32> @llvm.smax.v4i32 int4 test_max_int4(int4 p0, int4 p1) { return max(p0, p1); } -// CHECK: define noundef i32 @ +// CHECK-LABEL: define noundef i32 @_Z13test_max_uint // CHECK: call i32 @llvm.umax.i32( int test_max_uint(uint p0, uint p1) { return max(p0, p1); } -// CHECK: define noundef <2 x i32> @ +// CHECK-LABEL: define noundef <2 x i32> @_Z14test_max_uint2 // CHECK: call <2 x i32> @llvm.umax.v2i32 uint2 test_max_uint2(uint2 p0, uint2 p1) { return max(p0, p1); } -// CHECK: define noundef <3 x i32> @ +// CHECK-LABEL: define noundef <3 x i32> @_Z14test_max_uint3 // CHECK: call <3 x i32> @llvm.umax.v3i32 uint3 test_max_uint3(uint3 p0, uint3 p1) { return max(p0, p1); } -// CHECK: define noundef <4 x i32> @ +// CHECK-LABEL: define noundef <4 x i32> @_Z14test_max_uint4 // CHECK: call <4 x i32> @llvm.umax.v4i32 uint4 test_max_uint4(uint4 p0, uint4 p1) { return max(p0, p1); } -// CHECK: define noundef i64 @ +// CHECK-LABEL: define noundef i64 @_Z13test_max_long // CHECK: call i64 @llvm.smax.i64( int64_t test_max_long(int64_t p0, int64_t p1) { return max(p0, p1); } -// CHECK: define noundef <2 x i64> @ +// CHECK-LABEL: define noundef <2 x i64> @_Z14test_max_long2 // CHECK: call <2 x i64> @llvm.smax.v2i64 int64_t2 test_max_long2(int64_t2 p0, int64_t2 p1) { return max(p0, p1); } -// CHECK: define noundef <3 x i64> @ +// CHECK-LABEL: define noundef <3 x i64> @_Z14test_max_long3 // CHECK: call <3 x i64> @llvm.smax.v3i64 int64_t3 test_max_long3(int64_t3 p0, int64_t3 p1) { return max(p0, p1); } -// CHECK: define noundef <4 x i64> @ +// CHECK-LABEL: define noundef <4 x i64> @_Z14test_max_long4 // CHECK: call <4 x i64> @llvm.smax.v4i64 int64_t4 test_max_long4(int64_t4 p0, int64_t4 p1) { return max(p0, p1); } -// CHECK: define noundef i64 @ +// CHECK-LABEL: define noundef i64 @_Z14test_max_ulong // CHECK: call i64 @llvm.umax.i64( -uint64_t test_max_long(uint64_t p0, uint64_t p1) { return max(p0, p1); } -// CHECK: define noundef <2 x i64> @ +uint64_t test_max_ulong(uint64_t p0, uint64_t p1) { return max(p0, p1); } +// CHECK-LABEL: define noundef <2 x i64> @_Z15test_max_ulong2 // CHECK: call <2 x i64> @llvm.umax.v2i64 -uint64_t2 test_max_long2(uint64_t2 p0, uint64_t2 p1) { return max(p0, p1); } -// CHECK: define noundef <3 x i64> @ +uint64_t2 test_max_ulong2(uint64_t2 p0, uint64_t2 p1) { return max(p0, p1); } +// CHECK-LABEL: define noundef <3 x i64> @_Z15test_max_ulong3 // CHECK: call <3 x i64> @llvm.umax.v3i64 -uint64_t3 test_max_long3(uint64_t3 p0, uint64_t3 p1) { return max(p0, p1); } -// CHECK: define noundef <4 x i64> @ +uint64_t3 test_max_ulong3(uint64_t3 p0, uint64_t3 p1) { return max(p0, p1); } +// CHECK-LABEL: define noundef <4 x i64> @_Z15test_max_ulong4 // CHECK: call <4 x i64> @llvm.umax.v4i64 -uint64_t4 test_max_long4(uint64_t4 p0, uint64_t4 p1) { return max(p0, p1); } +uint64_t4 test_max_ulong4(uint64_t4 p0, uint64_t4 p1) { return max(p0, p1); } -// NATIVE_HALF: define noundef half @ +// NATIVE_HALF-LABEL: define noundef half @_Z13test_max_half // NATIVE_HALF: call half @llvm.maxnum.f16( -// NO_HALF: define noundef float @"?test_max_half +// NO_HALF-LABEL: define noundef float @_Z13test_max_half // NO_HALF: call float @llvm.maxnum.f32( half test_max_half(half p0, half p1) { return max(p0, p1); } -// NATIVE_HALF: define noundef <2 x half> @ +// NATIVE_HALF-LABEL: define noundef <2 x half> @_Z14test_max_half2 // NATIVE_HALF: call <2 x half> @llvm.maxnum.v2f16 -// NO_HALF: define noundef <2 x float> @"?test_max_half2 +// NO_HALF-LABEL: define noundef <2 x float> @_Z14test_max_half2 // NO_HALF: call <2 x float> @llvm.maxnum.v2f32( half2 test_max_half2(half2 p0, half2 p1) { return max(p0, p1); } -// NATIVE_HALF: define noundef <3 x half> @ +// NATIVE_HALF-LABEL: define noundef <3 x half> @_Z14test_max_half3 // NATIVE_HALF: call <3 x half> @llvm.maxnum.v3f16 -// NO_HALF: define noundef <3 x float> @"?test_max_half3 +// NO_HALF-LABEL: define noundef <3 x float> @_Z14test_max_half3 // NO_HALF: call <3 x float> @llvm.maxnum.v3f32( half3 test_max_half3(half3 p0, half3 p1) { return max(p0, p1); } -// NATIVE_HALF: define noundef <4 x half> @ +// NATIVE_HALF-LABEL: define noundef <4 x half> @_Z14test_max_half4 // NATIVE_HALF: call <4 x half> @llvm.maxnum.v4f16 -// NO_HALF: define noundef <4 x float> @"?test_max_half4 +// NO_HALF-LABEL: define noundef <4 x float> @_Z14test_max_half4 // NO_HALF: call <4 x float> @llvm.maxnum.v4f32( half4 test_max_half4(half4 p0, half4 p1) { return max(p0, p1); } -// CHECK: define noundef float @"?test_max_float +// CHECK-LABEL: define noundef float @_Z14test_max_float // CHECK: call float @llvm.maxnum.f32( float test_max_float(float p0, float p1) { return max(p0, p1); } -// CHECK: define noundef <2 x float> @"?test_max_float2 +// CHECK-LABEL: define noundef <2 x float> @_Z15test_max_float2 // CHECK: call <2 x float> @llvm.maxnum.v2f32 float2 test_max_float2(float2 p0, float2 p1) { return max(p0, p1); } -// CHECK: define noundef <3 x float> @"?test_max_float3 +// CHECK-LABEL: define noundef <3 x float> @_Z15test_max_float3 // CHECK: call <3 x float> @llvm.maxnum.v3f32 float3 test_max_float3(float3 p0, float3 p1) { return max(p0, p1); } -// CHECK: define noundef <4 x float> @"?test_max_float4 +// CHECK-LABEL: define noundef <4 x float> @_Z15test_max_float4 // CHECK: call <4 x float> @llvm.maxnum.v4f32 float4 test_max_float4(float4 p0, float4 p1) { return max(p0, p1); } -// CHECK: define noundef double @ +// CHECK-LABEL: define noundef double @_Z15test_max_double // CHECK: call double @llvm.maxnum.f64( double test_max_double(double p0, double p1) { return max(p0, p1); } -// CHECK: define noundef <2 x double> @ +// CHECK-LABEL: define noundef <2 x double> @_Z16test_max_double2 // CHECK: call <2 x double> @llvm.maxnum.v2f64 double2 test_max_double2(double2 p0, double2 p1) { return max(p0, p1); } -// CHECK: define noundef <3 x double> @ +// CHECK-LABEL: define noundef <3 x double> @_Z16test_max_double3 // CHECK: call <3 x double> @llvm.maxnum.v3f64 double3 test_max_double3(double3 p0, double3 p1) { return max(p0, p1); } -// CHECK: define noundef <4 x double> @ +// CHECK-LABEL: define noundef <4 x double> @_Z16test_max_double4 // CHECK: call <4 x double> @llvm.maxnum.v4f64 double4 test_max_double4(double4 p0, double4 p1) { return max(p0, p1); } diff --git a/clang/test/CodeGenHLSL/builtins/min.hlsl b/clang/test/CodeGenHLSL/builtins/min.hlsl index a0c233dac4d5f..02d20d13f916d 100644 --- a/clang/test/CodeGenHLSL/builtins/min.hlsl +++ b/clang/test/CodeGenHLSL/builtins/min.hlsl @@ -1,134 +1,133 @@ -// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple \ -// RUN: dxil-pc-shadermodel6.3-library %s -fnative-half-type \ -// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s \ -// RUN: --check-prefixes=CHECK,NATIVE_HALF -// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple \ -// RUN: dxil-pc-shadermodel6.3-library %s -emit-llvm -disable-llvm-passes \ -// RUN: -o - | FileCheck %s --check-prefixes=CHECK,NO_HALF +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \ +// RUN: -fnative-half-type -emit-llvm -disable-llvm-passes -o - | \ +// RUN: FileCheck %s --check-prefixes=CHECK,NATIVE_HALF +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \ +// RUN: -emit-llvm -disable-llvm-passes -o - | \ +// RUN: FileCheck %s --check-prefixes=CHECK,NO_HALF #ifdef __HLSL_ENABLE_16_BIT -// NATIVE_HALF: define noundef i16 @ +// NATIVE_HALF-LABEL: define noundef i16 @_Z14test_min_short // NATIVE_HALF: call i16 @llvm.smin.i16( int16_t test_min_short(int16_t p0, int16_t p1) { return min(p0, p1); } -// NATIVE_HALF: define noundef <2 x i16> @ +// NATIVE_HALF-LABEL: define noundef <2 x i16> @_Z15test_min_short2 // NATIVE_HALF: call <2 x i16> @llvm.smin.v2i16( int16_t2 test_min_short2(int16_t2 p0, int16_t2 p1) { return min(p0, p1); } -// NATIVE_HALF: define noundef <3 x i16> @ +// NATIVE_HALF-LABEL: define noundef <3 x i16> @_Z15test_min_short3 // NATIVE_HALF: call <3 x i16> @llvm.smin.v3i16 int16_t3 test_min_short3(int16_t3 p0, int16_t3 p1) { return min(p0, p1); } -// NATIVE_HALF: define noundef <4 x i16> @ +// NATIVE_HALF-LABEL: define noundef <4 x i16> @_Z15test_min_short4 // NATIVE_HALF: call <4 x i16> @llvm.smin.v4i16 int16_t4 test_min_short4(int16_t4 p0, int16_t4 p1) { return min(p0, p1); } -// NATIVE_HALF: define noundef i16 @ +// NATIVE_HALF-LABEL: define noundef i16 @_Z15test_min_ushort // NATIVE_HALF: call i16 @llvm.umin.i16( uint16_t test_min_ushort(uint16_t p0, uint16_t p1) { return min(p0, p1); } -// NATIVE_HALF: define noundef <2 x i16> @ +// NATIVE_HALF-LABEL: define noundef <2 x i16> @_Z16test_min_ushort2 // NATIVE_HALF: call <2 x i16> @llvm.umin.v2i16 uint16_t2 test_min_ushort2(uint16_t2 p0, uint16_t2 p1) { return min(p0, p1); } -// NATIVE_HALF: define noundef <3 x i16> @ +// NATIVE_HALF-LABEL: define noundef <3 x i16> @_Z16test_min_ushort3 // NATIVE_HALF: call <3 x i16> @llvm.umin.v3i16 uint16_t3 test_min_ushort3(uint16_t3 p0, uint16_t3 p1) { return min(p0, p1); } -// NATIVE_HALF: define noundef <4 x i16> @ +// NATIVE_HALF-LABEL: define noundef <4 x i16> @_Z16test_min_ushort4 // NATIVE_HALF: call <4 x i16> @llvm.umin.v4i16 uint16_t4 test_min_ushort4(uint16_t4 p0, uint16_t4 p1) { return min(p0, p1); } #endif -// CHECK: define noundef i32 @ +// CHECK-LABEL: define noundef i32 @_Z12test_min_int // CHECK: call i32 @llvm.smin.i32( int test_min_int(int p0, int p1) { return min(p0, p1); } -// CHECK: define noundef <2 x i32> @ +// CHECK-LABEL: define noundef <2 x i32> @_Z13test_min_int2 // CHECK: call <2 x i32> @llvm.smin.v2i32 int2 test_min_int2(int2 p0, int2 p1) { return min(p0, p1); } -// CHECK: define noundef <3 x i32> @ +// CHECK-LABEL: define noundef <3 x i32> @_Z13test_min_int3 // CHECK: call <3 x i32> @llvm.smin.v3i32 int3 test_min_int3(int3 p0, int3 p1) { return min(p0, p1); } -// CHECK: define noundef <4 x i32> @ +// CHECK-LABEL: define noundef <4 x i32> @_Z13test_min_int4 // CHECK: call <4 x i32> @llvm.smin.v4i32 int4 test_min_int4(int4 p0, int4 p1) { return min(p0, p1); } -// CHECK: define noundef i32 @ +// CHECK-LABEL: define noundef i32 @_Z13test_min_uint // CHECK: call i32 @llvm.umin.i32( int test_min_uint(uint p0, uint p1) { return min(p0, p1); } -// CHECK: define noundef <2 x i32> @ +// CHECK-LABEL: define noundef <2 x i32> @_Z14test_min_uint2 // CHECK: call <2 x i32> @llvm.umin.v2i32 uint2 test_min_uint2(uint2 p0, uint2 p1) { return min(p0, p1); } -// CHECK: define noundef <3 x i32> @ +// CHECK-LABEL: define noundef <3 x i32> @_Z14test_min_uint3 // CHECK: call <3 x i32> @llvm.umin.v3i32 uint3 test_min_uint3(uint3 p0, uint3 p1) { return min(p0, p1); } -// CHECK: define noundef <4 x i32> @ +// CHECK-LABEL: define noundef <4 x i32> @_Z14test_min_uint4 // CHECK: call <4 x i32> @llvm.umin.v4i32 uint4 test_min_uint4(uint4 p0, uint4 p1) { return min(p0, p1); } -// CHECK: define noundef i64 @ +// CHECK-LABEL: define noundef i64 @_Z13test_min_long // CHECK: call i64 @llvm.smin.i64( int64_t test_min_long(int64_t p0, int64_t p1) { return min(p0, p1); } -// CHECK: define noundef <2 x i64> @ +// CHECK-LABEL: define noundef <2 x i64> @_Z14test_min_long2 // CHECK: call <2 x i64> @llvm.smin.v2i64 int64_t2 test_min_long2(int64_t2 p0, int64_t2 p1) { return min(p0, p1); } -// CHECK: define noundef <3 x i64> @ +// CHECK-LABEL: define noundef <3 x i64> @_Z14test_min_long3 // CHECK: call <3 x i64> @llvm.smin.v3i64 int64_t3 test_min_long3(int64_t3 p0, int64_t3 p1) { return min(p0, p1); } -// CHECK: define noundef <4 x i64> @ +// CHECK-LABEL: define noundef <4 x i64> @_Z14test_min_long4 // CHECK: call <4 x i64> @llvm.smin.v4i64 int64_t4 test_min_long4(int64_t4 p0, int64_t4 p1) { return min(p0, p1); } -// CHECK: define noundef i64 @ +// CHECK-LABEL: define noundef i64 @_Z14test_min_ulong // CHECK: call i64 @llvm.umin.i64( -uint64_t test_min_long(uint64_t p0, uint64_t p1) { return min(p0, p1); } -// CHECK: define noundef <2 x i64> @ +uint64_t test_min_ulong(uint64_t p0, uint64_t p1) { return min(p0, p1); } +// CHECK-LABEL: define noundef <2 x i64> @_Z15test_min_ulong2 // CHECK: call <2 x i64> @llvm.umin.v2i64 -uint64_t2 test_min_long2(uint64_t2 p0, uint64_t2 p1) { return min(p0, p1); } -// CHECK: define noundef <3 x i64> @ +uint64_t2 test_min_ulong2(uint64_t2 p0, uint64_t2 p1) { return min(p0, p1); } +// CHECK-LABEL: define noundef <3 x i64> @_Z15test_min_ulong3 // CHECK: call <3 x i64> @llvm.umin.v3i64 -uint64_t3 test_min_long3(uint64_t3 p0, uint64_t3 p1) { return min(p0, p1); } -// CHECK: define noundef <4 x i64> @ +uint64_t3 test_min_ulong3(uint64_t3 p0, uint64_t3 p1) { return min(p0, p1); } +// CHECK-LABEL: define noundef <4 x i64> @_Z15test_min_ulong4 // CHECK: call <4 x i64> @llvm.umin.v4i64 -uint64_t4 test_min_long4(uint64_t4 p0, uint64_t4 p1) { return min(p0, p1); } +uint64_t4 test_min_ulong4(uint64_t4 p0, uint64_t4 p1) { return min(p0, p1); } -// NATIVE_HALF: define noundef half @ +// NATIVE_HALF-LABEL: define noundef half @_Z13test_min_half // NATIVE_HALF: call half @llvm.minnum.f16( -// NO_HALF: define noundef float @"?test_min_half +// NO_HALF-LABEL: define noundef float @_Z13test_min_half // NO_HALF: call float @llvm.minnum.f32( half test_min_half(half p0, half p1) { return min(p0, p1); } -// NATIVE_HALF: define noundef <2 x half> @ +// NATIVE_HALF-LABEL: define noundef <2 x half> @_Z14test_min_half2 // NATIVE_HALF: call <2 x half> @llvm.minnum.v2f16 -// NO_HALF: define noundef <2 x float> @"?test_min_half2 +// NO_HALF-LABEL: define noundef <2 x float> @_Z14test_min_half2 // NO_HALF: call <2 x float> @llvm.minnum.v2f32( half2 test_min_half2(half2 p0, half2 p1) { return min(p0, p1); } -// NATIVE_HALF: define noundef <3 x half> @ +// NATIVE_HALF-LABEL: define noundef <3 x half> @_Z14test_min_half3 // NATIVE_HALF: call <3 x half> @llvm.minnum.v3f16 -// NO_HALF: define noundef <3 x float> @"?test_min_half3 +// NO_HALF-LABEL: define noundef <3 x float> @_Z14test_min_half3 // NO_HALF: call <3 x float> @llvm.minnum.v3f32( half3 test_min_half3(half3 p0, half3 p1) { return min(p0, p1); } -// NATIVE_HALF: define noundef <4 x half> @ +// NATIVE_HALF-LABEL: define noundef <4 x half> @_Z14test_min_half4 // NATIVE_HALF: call <4 x half> @llvm.minnum.v4f16 -// NO_HALF: define noundef <4 x float> @"?test_min_half4 +// NO_HALF-LABEL: define noundef <4 x float> @_Z14test_min_half4 // NO_HALF: call <4 x float> @llvm.minnum.v4f32( half4 test_min_half4(half4 p0, half4 p1) { return min(p0, p1); } -// CHECK: define noundef float @ +// CHECK-LABEL: define noundef float @_Z14test_min_float // CHECK: call float @llvm.minnum.f32( float test_min_float(float p0, float p1) { return min(p0, p1); } -// CHECK: define noundef <2 x float> @ +// CHECK-LABEL: define noundef <2 x float> @_Z15test_min_float2 // CHECK: call <2 x float> @llvm.minnum.v2f32 float2 test_min_float2(float2 p0, float2 p1) { return min(p0, p1); } -// CHECK: define noundef <3 x float> @ +// CHECK-LABEL: define noundef <3 x float> @_Z15test_min_float3 // CHECK: call <3 x float> @llvm.minnum.v3f32 float3 test_min_float3(float3 p0, float3 p1) { return min(p0, p1); } -// CHECK: define noundef <4 x float> @ +// CHECK-LABEL: define noundef <4 x float> @_Z15test_min_float4 // CHECK: call <4 x float> @llvm.minnum.v4f32 float4 test_min_float4(float4 p0, float4 p1) { return min(p0, p1); } -// CHECK: define noundef double @ +// CHECK-LABEL: define noundef double @_Z15test_min_double // CHECK: call double @llvm.minnum.f64( double test_min_double(double p0, double p1) { return min(p0, p1); } -// CHECK: define noundef <2 x double> @ +// CHECK-LABEL: define noundef <2 x double> @_Z16test_min_double2 // CHECK: call <2 x double> @llvm.minnum.v2f64 double2 test_min_double2(double2 p0, double2 p1) { return min(p0, p1); } -// CHECK: define noundef <3 x double> @ +// CHECK-LABEL: define noundef <3 x double> @_Z16test_min_double3 // CHECK: call <3 x double> @llvm.minnum.v3f64 double3 test_min_double3(double3 p0, double3 p1) { return min(p0, p1); } -// CHECK: define noundef <4 x double> @ +// CHECK-LABEL: define noundef <4 x double> @_Z16test_min_double4 // CHECK: call <4 x double> @llvm.minnum.v4f64 double4 test_min_double4(double4 p0, double4 p1) { return min(p0, p1); } diff --git a/clang/test/CodeGenHLSL/builtins/pow.hlsl b/clang/test/CodeGenHLSL/builtins/pow.hlsl index 9a2264e740751..4e18480763343 100644 --- a/clang/test/CodeGenHLSL/builtins/pow.hlsl +++ b/clang/test/CodeGenHLSL/builtins/pow.hlsl @@ -1,41 +1,40 @@ -// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple \ -// RUN: dxil-pc-shadermodel6.3-library %s -fnative-half-type \ -// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s \ -// RUN: --check-prefixes=CHECK,NATIVE_HALF -// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple \ -// RUN: dxil-pc-shadermodel6.3-library %s -emit-llvm -disable-llvm-passes \ -// RUN: -o - | FileCheck %s --check-prefixes=CHECK,NO_HALF +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \ +// RUN: -fnative-half-type -emit-llvm -disable-llvm-passes -o - | \ +// RUN: FileCheck %s --check-prefixes=CHECK,NATIVE_HALF +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \ +// RUN: -emit-llvm -disable-llvm-passes -o - | \ +// RUN: FileCheck %s --check-prefixes=CHECK,NO_HALF -// NATIVE_HALF: define noundef half @ +// NATIVE_HALF-LABEL: define noundef half @_Z13test_pow_half // NATIVE_HALF: call half @llvm.pow.f16( -// NO_HALF: define noundef float @"?test_pow_half +// NO_HALF-LABEL: define noundef float @_Z13test_pow_half // NO_HALF: call float @llvm.pow.f32( half test_pow_half(half p0, half p1) { return pow(p0, p1); } -// NATIVE_HALF: define noundef <2 x half> @"?test_pow_half2 +// NATIVE_HALF-LABEL: define noundef <2 x half> @_Z14test_pow_half2 // NATIVE_HALF: call <2 x half> @llvm.pow.v2f16 -// NO_HALF: define noundef <2 x float> @"?test_pow_half2 +// NO_HALF-LABEL: define noundef <2 x float> @_Z14test_pow_half2 // NO_HALF: call <2 x float> @llvm.pow.v2f32( half2 test_pow_half2(half2 p0, half2 p1) { return pow(p0, p1); } -// NATIVE_HALF: define noundef <3 x half> @"?test_pow_half3 +// NATIVE_HALF-LABEL: define noundef <3 x half> @_Z14test_pow_half3 // NATIVE_HALF: call <3 x half> @llvm.pow.v3f16 -// NO_HALF: define noundef <3 x float> @"?test_pow_half3 +// NO_HALF-LABEL: define noundef <3 x float> @_Z14test_pow_half3 // NO_HALF: call <3 x float> @llvm.pow.v3f32( half3 test_pow_half3(half3 p0, half3 p1) { return pow(p0, p1); } -// NATIVE_HALF: define noundef <4 x half> @"?test_pow_half4 +// NATIVE_HALF-LABEL: define noundef <4 x half> @_Z14test_pow_half4 // NATIVE_HALF: call <4 x half> @llvm.pow.v4f16 -// NO_HALF: define noundef <4 x float> @"?test_pow_half4 +// NO_HALF-LABEL: define noundef <4 x float> @_Z14test_pow_half4 // NO_HALF: call <4 x float> @llvm.pow.v4f32( half4 test_pow_half4(half4 p0, half4 p1) { return pow(p0, p1); } -// CHECK: define noundef float @"?test_pow_float +// CHECK-LABEL: define noundef float @_Z14test_pow_float // CHECK: call float @llvm.pow.f32( float test_pow_float(float p0, float p1) { return pow(p0, p1); } -// CHECK: define noundef <2 x float> @"?test_pow_float2 +// CHECK-LABEL: define noundef <2 x float> @_Z15test_pow_float2 // CHECK: call <2 x float> @llvm.pow.v2f32 float2 test_pow_float2(float2 p0, float2 p1) { return pow(p0, p1); } -// CHECK: define noundef <3 x float> @"?test_pow_float3 +// CHECK-LABEL: define noundef <3 x float> @_Z15test_pow_float3 // CHECK: call <3 x float> @llvm.pow.v3f32 float3 test_pow_float3(float3 p0, float3 p1) { return pow(p0, p1); } -// CHECK: define noundef <4 x float> @"?test_pow_float4 +// CHECK-LABEL: define noundef <4 x float> @_Z15test_pow_float4 // CHECK: call <4 x float> @llvm.pow.v4f32 float4 test_pow_float4(float4 p0, float4 p1) { return pow(p0, p1); } diff --git a/clang/test/CodeGenHLSL/builtins/round.hlsl b/clang/test/CodeGenHLSL/builtins/round.hlsl index 33d761dbdfbea..6da63a394a8fd 100644 --- a/clang/test/CodeGenHLSL/builtins/round.hlsl +++ b/clang/test/CodeGenHLSL/builtins/round.hlsl @@ -1,53 +1,52 @@ -// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \ -// RUN: dxil-pc-shadermodel6.3-library %s -fnative-half-type \ -// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s \ -// RUN: --check-prefixes=CHECK,NATIVE_HALF -// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \ -// RUN: dxil-pc-shadermodel6.3-library %s -emit-llvm -disable-llvm-passes \ -// RUN: -o - | FileCheck %s --check-prefixes=CHECK,NO_HALF +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \ +// RUN: -fnative-half-type -emit-llvm -disable-llvm-passes -o - | \ +// RUN: FileCheck %s --check-prefixes=CHECK,NATIVE_HALF +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \ +// RUN: -emit-llvm -disable-llvm-passes -o - | \ +// RUN: FileCheck %s --check-prefixes=CHECK,NO_HALF -// NATIVE_HALF: define noundef half @ +// NATIVE_HALF-LABEL: define noundef half @_Z15test_round_half // NATIVE_HALF: %elt.roundeven = call half @llvm.roundeven.f16( // NATIVE_HALF: ret half %elt.roundeven -// NO_HALF: define noundef float @"?test_round_half@@YA$halff@$halff@@Z"( +// NO_HALF-LABEL: define noundef float @_Z15test_round_half // NO_HALF: %elt.roundeven = call float @llvm.roundeven.f32( // NO_HALF: ret float %elt.roundeven half test_round_half(half p0) { return round(p0); } -// NATIVE_HALF: define noundef <2 x half> @ +// NATIVE_HALF-LABEL: define noundef <2 x half> @_Z16test_round_half2 // NATIVE_HALF: %elt.roundeven = call <2 x half> @llvm.roundeven.v2f16 // NATIVE_HALF: ret <2 x half> %elt.roundeven -// NO_HALF: define noundef <2 x float> @ +// NO_HALF-LABEL: define noundef <2 x float> @_Z16test_round_half2 // NO_HALF: %elt.roundeven = call <2 x float> @llvm.roundeven.v2f32( // NO_HALF: ret <2 x float> %elt.roundeven half2 test_round_half2(half2 p0) { return round(p0); } -// NATIVE_HALF: define noundef <3 x half> @ +// NATIVE_HALF-LABEL: define noundef <3 x half> @_Z16test_round_half3 // NATIVE_HALF: %elt.roundeven = call <3 x half> @llvm.roundeven.v3f16 // NATIVE_HALF: ret <3 x half> %elt.roundeven -// NO_HALF: define noundef <3 x float> @ +// NO_HALF-LABEL: define noundef <3 x float> @_Z16test_round_half3 // NO_HALF: %elt.roundeven = call <3 x float> @llvm.roundeven.v3f32( // NO_HALF: ret <3 x float> %elt.roundeven half3 test_round_half3(half3 p0) { return round(p0); } -// NATIVE_HALF: define noundef <4 x half> @ +// NATIVE_HALF-LABEL: define noundef <4 x half> @_Z16test_round_half4 // NATIVE_HALF: %elt.roundeven = call <4 x half> @llvm.roundeven.v4f16 // NATIVE_HALF: ret <4 x half> %elt.roundeven -// NO_HALF: define noundef <4 x float> @ +// NO_HALF-LABEL: define noundef <4 x float> @_Z16test_round_half4 // NO_HALF: %elt.roundeven = call <4 x float> @llvm.roundeven.v4f32( // NO_HALF: ret <4 x float> %elt.roundeven half4 test_round_half4(half4 p0) { return round(p0); } -// CHECK: define noundef float @ +// CHECK-LABEL: define noundef float @_Z16test_round_float // CHECK: %elt.roundeven = call float @llvm.roundeven.f32( // CHECK: ret float %elt.roundeven float test_round_float(float p0) { return round(p0); } -// CHECK: define noundef <2 x float> @ +// CHECK-LABEL: define noundef <2 x float> @_Z17test_round_float2 // CHECK: %elt.roundeven = call <2 x float> @llvm.roundeven.v2f32 // CHECK: ret <2 x float> %elt.roundeven float2 test_round_float2(float2 p0) { return round(p0); } -// CHECK: define noundef <3 x float> @ +// CHECK-LABEL: define noundef <3 x float> @_Z17test_round_float3 // CHECK: %elt.roundeven = call <3 x float> @llvm.roundeven.v3f32 // CHECK: ret <3 x float> %elt.roundeven float3 test_round_float3(float3 p0) { return round(p0); } -// CHECK: define noundef <4 x float> @ +// CHECK-LABEL: define noundef <4 x float> @_Z17test_round_float4 // CHECK: %elt.roundeven = call <4 x float> @llvm.roundeven.v4f32 // CHECK: ret <4 x float> %elt.roundeven float4 test_round_float4(float4 p0) { return round(p0); } diff --git a/clang/test/CodeGenHLSL/builtins/saturate.hlsl b/clang/test/CodeGenHLSL/builtins/saturate.hlsl index 65a3cd74621cc..c221f6e0f2c36 100644 --- a/clang/test/CodeGenHLSL/builtins/saturate.hlsl +++ b/clang/test/CodeGenHLSL/builtins/saturate.hlsl @@ -1,95 +1,60 @@ -// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple \ -// RUN: dxil-pc-shadermodel6.3-library %s -fnative-half-type \ -// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s \ -// RUN: --check-prefixes=CHECK,NATIVE_HALF -// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple \ -// RUN: dxil-pc-shadermodel6.3-library %s -emit-llvm -disable-llvm-passes \ -// RUN: -o - | FileCheck %s --check-prefixes=CHECK,NO_HALF +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \ +// RUN: -fnative-half-type -emit-llvm -disable-llvm-passes -o - | \ +// RUN: FileCheck %s --check-prefixes=CHECK,NATIVE_HALF -Dtar=dx +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \ +// RUN: -emit-llvm -disable-llvm-passes -o - | \ +// RUN: FileCheck %s --check-prefixes=CHECK,NO_HALF -Dtar=dx -// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple \ -// RUN: spirv-unknown-vulkan-library %s -fnative-half-type \ -// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s \ -// RUN: --check-prefixes=SPIRV,SPIRV_HALF -// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple \ -// RUN: spirv-unknown-vulkan-library %s \ -// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s \ -// RUN: --check-prefixes=SPIRV,SPIRV_NO_HALF +// RUN: %clang_cc1 -finclude-default-header -triple spirv-unknown-vulkan-library %s \ +// RUN: -fnative-half-type -emit-llvm -disable-llvm-passes -o - | \ +// RUN: FileCheck %s --check-prefixes=CHECK,NATIVE_HALF -Dtar=spv +// RUN: %clang_cc1 -finclude-default-header -triple spirv-unknown-vulkan-library %s \ +// RUN: -emit-llvm -disable-llvm-passes -o - | \ +// RUN: FileCheck %s --check-prefixes=CHECK,NO_HALF -Dtar=spv -// NATIVE_HALF: define noundef half @ -// NATIVE_HALF: call half @llvm.dx.saturate.f16( -// NO_HALF: define noundef float @"?test_saturate_half -// NO_HALF: call float @llvm.dx.saturate.f32( -// SPIRV_HALF: define spir_func noundef half @_Z18test_saturate_halfDh(half -// SPIRV_HALF: call half @llvm.spv.saturate.f16(half -// SPIRV_NO_HALF: define spir_func noundef float @_Z18test_saturate_halfDh(float -// SPIRV_NO_HALF: call float @llvm.spv.saturate.f32(float +// NATIVE_HALF-LABEL: define{{.*}} half @_Z18test_saturate_halfDh +// NATIVE_HALF: call half @llvm.[[tar]].saturate.f16( +// NO_HALF-LABEL: define{{.*}} float @_Z18test_saturate_halfDh +// NO_HALF: call float @llvm.[[tar]].saturate.f32( half test_saturate_half(half p0) { return saturate(p0); } -// NATIVE_HALF: define noundef <2 x half> @ -// NATIVE_HALF: call <2 x half> @llvm.dx.saturate.v2f16 -// NO_HALF: define noundef <2 x float> @"?test_saturate_half2 -// NO_HALF: call <2 x float> @llvm.dx.saturate.v2f32( -// SPIRV_HALF: define spir_func noundef <2 x half> @_Z19test_saturate_half2Dv2_Dh( -// SPIRV_HALF: call <2 x half> @llvm.spv.saturate.v2f16(<2 x half> -// SPIRV_NO_HALF: define spir_func noundef <2 x float> @_Z19test_saturate_half2Dv2_Dh(<2 x float> -// SPIRV_NO_HALF: call <2 x float> @llvm.spv.saturate.v2f32(<2 x float> +// NATIVE_HALF-LABEL: define{{.*}} <2 x half> @_Z19test_saturate_half2Dv2_Dh +// NATIVE_HALF: call <2 x half> @llvm.[[tar]].saturate.v2f16 +// NO_HALF-LABEL: define{{.*}} <2 x float> @_Z19test_saturate_half2Dv2_Dh +// NO_HALF: call <2 x float> @llvm.[[tar]].saturate.v2f32( half2 test_saturate_half2(half2 p0) { return saturate(p0); } -// NATIVE_HALF: define noundef <3 x half> @ -// NATIVE_HALF: call <3 x half> @llvm.dx.saturate.v3f16 -// NO_HALF: define noundef <3 x float> @"?test_saturate_half3 -// NO_HALF: call <3 x float> @llvm.dx.saturate.v3f32( -// SPIRV_HALF: define spir_func noundef <3 x half> @_Z19test_saturate_half3Dv3_Dh( -// SPIRV_HALF: call <3 x half> @llvm.spv.saturate.v3f16(<3 x half> -// SPIRV_NO_HALF: define spir_func noundef <3 x float> @_Z19test_saturate_half3Dv3_Dh(<3 x float> -// SPIRV_NO_HALF: call <3 x float> @llvm.spv.saturate.v3f32(<3 x float> +// NATIVE_HALF-LABEL: define{{.*}} <3 x half> @_Z19test_saturate_half3Dv3_Dh( +// NATIVE_HALF: call <3 x half> @llvm.[[tar]].saturate.v3f16 +// NO_HALF-LABEL: define{{.*}} <3 x float> @_Z19test_saturate_half3Dv3_Dh(<3 x float> +// NO_HALF: call <3 x float> @llvm.[[tar]].saturate.v3f32( half3 test_saturate_half3(half3 p0) { return saturate(p0); } -// NATIVE_HALF: define noundef <4 x half> @ -// NATIVE_HALF: call <4 x half> @llvm.dx.saturate.v4f16 -// NO_HALF: define noundef <4 x float> @"?test_saturate_half4 -// NO_HALF: call <4 x float> @llvm.dx.saturate.v4f32( -// SPIRV_HALF: define spir_func noundef <4 x half> @_Z19test_saturate_half4Dv4_Dh( -// SPIRV_HALF: call <4 x half> @llvm.spv.saturate.v4f16(<4 x half> -// SPIRV_NO_HALF: define spir_func noundef <4 x float> @_Z19test_saturate_half4Dv4_Dh(<4 x float> -// SPIRV_NO_HALF: call <4 x float> @llvm.spv.saturate.v4f32(<4 x float> +// NATIVE_HALF-LABEL: define{{.*}} <4 x half> @_Z19test_saturate_half4Dv4_Dh( +// NATIVE_HALF: call <4 x half> @llvm.[[tar]].saturate.v4f16 +// NO_HALF-LABEL: define{{.*}} <4 x float> @_Z19test_saturate_half4Dv4_Dh(<4 x float> +// NO_HALF: call <4 x float> @llvm.[[tar]].saturate.v4f32( half4 test_saturate_half4(half4 p0) { return saturate(p0); } -// CHECK: define noundef float @"?test_saturate_float -// CHECK: call float @llvm.dx.saturate.f32( -// SPIRV: define spir_func noundef float @_Z19test_saturate_floatf(float -// SPIRV: call float @llvm.spv.saturate.f32(float +// CHECK-LABEL: define{{.*}} float @_Z19test_saturate_floatf( +// CHECK: call float @llvm.[[tar]].saturate.f32( float test_saturate_float(float p0) { return saturate(p0); } -// CHECK: define noundef <2 x float> @"?test_saturate_float2 -// CHECK: call <2 x float> @llvm.dx.saturate.v2f32 -// SPIRV: define spir_func noundef <2 x float> @_Z20test_saturate_float2Dv2_f(<2 x float> -// SPIRV: call <2 x float> @llvm.spv.saturate.v2f32(<2 x float> +// CHECK-LABEL: define{{.*}} <2 x float> @_Z20test_saturate_float2Dv2_f(<2 x float> +// CHECK: call <2 x float> @llvm.[[tar]].saturate.v2f32 float2 test_saturate_float2(float2 p0) { return saturate(p0); } -// CHECK: define noundef <3 x float> @"?test_saturate_float3 -// CHECK: call <3 x float> @llvm.dx.saturate.v3f32 -// SPIRV: define spir_func noundef <3 x float> @_Z20test_saturate_float3Dv3_f(<3 x float> -// SPIRV: call <3 x float> @llvm.spv.saturate.v3f32(<3 x float> +// CHECK-LABEL: define{{.*}} <3 x float> @_Z20test_saturate_float3Dv3_f(<3 x float> +// CHECK: call <3 x float> @llvm.[[tar]].saturate.v3f32 float3 test_saturate_float3(float3 p0) { return saturate(p0); } -// CHECK: define noundef <4 x float> @"?test_saturate_float4 -// CHECK: call <4 x float> @llvm.dx.saturate.v4f32 -// SPIRV: define spir_func noundef <4 x float> @_Z20test_saturate_float4Dv4_f(<4 x float> -// SPIRV: call <4 x float> @llvm.spv.saturate.v4f32(<4 x float> +// CHECK-LABEL: define{{.*}} <4 x float> @_Z20test_saturate_float4Dv4_f(<4 x float> +// CHECK: call <4 x float> @llvm.[[tar]].saturate.v4f32 float4 test_saturate_float4(float4 p0) { return saturate(p0); } -// CHECK: define noundef double @ -// CHECK: call double @llvm.dx.saturate.f64( -// SPIRV: define spir_func noundef double @_Z20test_saturate_doubled(double -// SPIRV: call double @llvm.spv.saturate.f64(double +// CHECK-LABEL: define{{.*}} double @_Z20test_saturate_doubled(double +// CHECK: call double @llvm.[[tar]].saturate.f64( double test_saturate_double(double p0) { return saturate(p0); } -// CHECK: define noundef <2 x double> @ -// CHECK: call <2 x double> @llvm.dx.saturate.v2f64 -// SPIRV: define spir_func noundef <2 x double> @_Z21test_saturate_double2Dv2_d(<2 x double> -// SPIRV: call <2 x double> @llvm.spv.saturate.v2f64(<2 x double> +// CHECK-LABEL: define{{.*}} <2 x double> @_Z21test_saturate_double2Dv2_d(<2 x double> +// CHECK: call <2 x double> @llvm.[[tar]].saturate.v2f64 double2 test_saturate_double2(double2 p0) { return saturate(p0); } -// CHECK: define noundef <3 x double> @ -// CHECK: call <3 x double> @llvm.dx.saturate.v3f64 -// SPIRV: define spir_func noundef <3 x double> @_Z21test_saturate_double3Dv3_d(<3 x double> -// SPIRV: call <3 x double> @llvm.spv.saturate.v3f64(<3 x double> +// CHECK-LABEL: define{{.*}} <3 x double> @_Z21test_saturate_double3Dv3_d(<3 x double> +// CHECK: call <3 x double> @llvm.[[tar]].saturate.v3f64 double3 test_saturate_double3(double3 p0) { return saturate(p0); } -// CHECK: define noundef <4 x double> @ -// CHECK: call <4 x double> @llvm.dx.saturate.v4f64 -// SPIRV: define spir_func noundef <4 x double> @_Z21test_saturate_double4Dv4_d(<4 x double> -// SPIRV: call <4 x double> @llvm.spv.saturate.v4f64(<4 x double> +// CHECK-LABEL: define{{.*}} <4 x double> @_Z21test_saturate_double4Dv4_d(<4 x double> +// CHECK: call <4 x double> @llvm.[[tar]].saturate.v4f64 double4 test_saturate_double4(double4 p0) { return saturate(p0); } diff --git a/clang/test/CodeGenHLSL/builtins/sin.hlsl b/clang/test/CodeGenHLSL/builtins/sin.hlsl index 83e8a5be39d06..9f7fa5043bdc7 100644 --- a/clang/test/CodeGenHLSL/builtins/sin.hlsl +++ b/clang/test/CodeGenHLSL/builtins/sin.hlsl @@ -1,41 +1,40 @@ -// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple \ -// RUN: dxil-pc-shadermodel6.3-library %s -fnative-half-type \ -// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s \ -// RUN: --check-prefixes=CHECK,NATIVE_HALF -// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple \ -// RUN: dxil-pc-shadermodel6.3-library %s -emit-llvm -disable-llvm-passes \ -// RUN: -o - | FileCheck %s --check-prefixes=CHECK,NO_HALF +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \ +// RUN: -fnative-half-type -emit-llvm -disable-llvm-passes -o - | \ +// RUN: FileCheck %s --check-prefixes=CHECK,NATIVE_HALF +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \ +// RUN: -emit-llvm -disable-llvm-passes -o - | \ +// RUN: FileCheck %s --check-prefixes=CHECK,NO_HALF -// NATIVE_HALF: define noundef half @ +// NATIVE_HALF-LABEL: define noundef half @_Z13test_sin_half // NATIVE_HALF: call half @llvm.sin.f16( -// NO_HALF: define noundef float @"?test_sin_half@@YA$halff@$halff@@Z"( +// NO_HALF-LABEL: define noundef float @_Z13test_sin_half // NO_HALF: call float @llvm.sin.f32( half test_sin_half(half p0) { return sin(p0); } -// NATIVE_HALF: define noundef <2 x half> @ +// NATIVE_HALF-LABEL: define noundef <2 x half> @_Z14test_sin_half2 // NATIVE_HALF: call <2 x half> @llvm.sin.v2f16 -// NO_HALF: define noundef <2 x float> @"?test_sin_half2 +// NO_HALF-LABEL: define noundef <2 x float> @_Z14test_sin_half2 // NO_HALF: call <2 x float> @llvm.sin.v2f32( half2 test_sin_half2(half2 p0) { return sin(p0); } -// NATIVE_HALF: define noundef <3 x half> @ +// NATIVE_HALF-LABEL: define noundef <3 x half> @_Z14test_sin_half3 // NATIVE_HALF: call <3 x half> @llvm.sin.v3f16 -// NO_HALF: define noundef <3 x float> @"?test_sin_half3 +// NO_HALF-LABEL: define noundef <3 x float> @_Z14test_sin_half3 // NO_HALF: call <3 x float> @llvm.sin.v3f32( half3 test_sin_half3(half3 p0) { return sin(p0); } -// NATIVE_HALF: define noundef <4 x half> @ +// NATIVE_HALF-LABEL: define noundef <4 x half> @_Z14test_sin_half4 // NATIVE_HALF: call <4 x half> @llvm.sin.v4f16 -// NO_HALF: define noundef <4 x float> @"?test_sin_half4 +// NO_HALF-LABEL: define noundef <4 x float> @_Z14test_sin_half4 // NO_HALF: call <4 x float> @llvm.sin.v4f32( half4 test_sin_half4(half4 p0) { return sin(p0); } -// CHECK: define noundef float @ +// CHECK-LABEL: define noundef float @_Z14test_sin_float // CHECK: call float @llvm.sin.f32( float test_sin_float(float p0) { return sin(p0); } -// CHECK: define noundef <2 x float> @ +// CHECK-LABEL: define noundef <2 x float> @_Z15test_sin_float2 // CHECK: call <2 x float> @llvm.sin.v2f32 float2 test_sin_float2(float2 p0) { return sin(p0); } -// CHECK: define noundef <3 x float> @ +// CHECK-LABEL: define noundef <3 x float> @_Z15test_sin_float3 // CHECK: call <3 x float> @llvm.sin.v3f32 float3 test_sin_float3(float3 p0) { return sin(p0); } -// CHECK: define noundef <4 x float> @ +// CHECK-LABEL: define noundef <4 x float> @_Z15test_sin_float4 // CHECK: call <4 x float> @llvm.sin.v4f32 float4 test_sin_float4(float4 p0) { return sin(p0); } diff --git a/clang/test/CodeGenHLSL/builtins/sqrt.hlsl b/clang/test/CodeGenHLSL/builtins/sqrt.hlsl index adbbf69a8e068..63454cea3fe6f 100644 --- a/clang/test/CodeGenHLSL/builtins/sqrt.hlsl +++ b/clang/test/CodeGenHLSL/builtins/sqrt.hlsl @@ -1,53 +1,52 @@ -// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \ -// RUN: dxil-pc-shadermodel6.3-library %s -fnative-half-type \ -// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s \ -// RUN: --check-prefixes=CHECK,NATIVE_HALF -// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \ -// RUN: dxil-pc-shadermodel6.3-library %s -emit-llvm -disable-llvm-passes \ -// RUN: -o - | FileCheck %s --check-prefixes=CHECK,NO_HALF +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \ +// RUN: -fnative-half-type -emit-llvm -disable-llvm-passes -o - | \ +// RUN: FileCheck %s --check-prefixes=CHECK,NATIVE_HALF +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \ +// RUN: -emit-llvm -disable-llvm-passes -o - | \ +// RUN: FileCheck %s --check-prefixes=CHECK,NO_HALF -// NATIVE_HALF: define noundef half @ +// NATIVE_HALF-LABEL: define noundef half @_Z14test_sqrt_half // NATIVE_HALF: %{{.*}} = call half @llvm.sqrt.f16( // NATIVE_HALF: ret half %{{.*}} -// NO_HALF: define noundef float @"?test_sqrt_half@@YA$halff@$halff@@Z"( +// NO_HALF-LABEL: define noundef float @_Z14test_sqrt_half // NO_HALF: %{{.*}} = call float @llvm.sqrt.f32( // NO_HALF: ret float %{{.*}} half test_sqrt_half(half p0) { return sqrt(p0); } -// NATIVE_HALF: define noundef <2 x half> @ +// NATIVE_HALF-LABEL: define noundef <2 x half> @_Z15test_sqrt_half2 // NATIVE_HALF: %{{.*}} = call <2 x half> @llvm.sqrt.v2f16 // NATIVE_HALF: ret <2 x half> %{{.*}} -// NO_HALF: define noundef <2 x float> @ +// NO_HALF-LABEL: define noundef <2 x float> @_Z15test_sqrt_half2 // NO_HALF: %{{.*}} = call <2 x float> @llvm.sqrt.v2f32( // NO_HALF: ret <2 x float> %{{.*}} half2 test_sqrt_half2(half2 p0) { return sqrt(p0); } -// NATIVE_HALF: define noundef <3 x half> @ +// NATIVE_HALF-LABEL: define noundef <3 x half> @_Z15test_sqrt_half3 // NATIVE_HALF: %{{.*}} = call <3 x half> @llvm.sqrt.v3f16 // NATIVE_HALF: ret <3 x half> %{{.*}} -// NO_HALF: define noundef <3 x float> @ +// NO_HALF-LABEL: define noundef <3 x float> @_Z15test_sqrt_half3 // NO_HALF: %{{.*}} = call <3 x float> @llvm.sqrt.v3f32( // NO_HALF: ret <3 x float> %{{.*}} half3 test_sqrt_half3(half3 p0) { return sqrt(p0); } -// NATIVE_HALF: define noundef <4 x half> @ +// NATIVE_HALF-LABEL: define noundef <4 x half> @_Z15test_sqrt_half4 // NATIVE_HALF: %{{.*}} = call <4 x half> @llvm.sqrt.v4f16 // NATIVE_HALF: ret <4 x half> %{{.*}} -// NO_HALF: define noundef <4 x float> @ +// NO_HALF-LABEL: define noundef <4 x float> @_Z15test_sqrt_half4 // NO_HALF: %{{.*}} = call <4 x float> @llvm.sqrt.v4f32( // NO_HALF: ret <4 x float> %{{.*}} half4 test_sqrt_half4(half4 p0) { return sqrt(p0); } -// CHECK: define noundef float @ +// CHECK-LABEL: define noundef float @_Z15test_sqrt_float // CHECK: %{{.*}} = call float @llvm.sqrt.f32( // CHECK: ret float %{{.*}} float test_sqrt_float(float p0) { return sqrt(p0); } -// CHECK: define noundef <2 x float> @ +// CHECK-LABEL: define noundef <2 x float> @_Z16test_sqrt_float2 // CHECK: %{{.*}} = call <2 x float> @llvm.sqrt.v2f32 // CHECK: ret <2 x float> %{{.*}} float2 test_sqrt_float2(float2 p0) { return sqrt(p0); } -// CHECK: define noundef <3 x float> @ +// CHECK-LABEL: define noundef <3 x float> @_Z16test_sqrt_float3 // CHECK: %{{.*}} = call <3 x float> @llvm.sqrt.v3f32 // CHECK: ret <3 x float> %{{.*}} float3 test_sqrt_float3(float3 p0) { return sqrt(p0); } -// CHECK: define noundef <4 x float> @ +// CHECK-LABEL: define noundef <4 x float> @_Z16test_sqrt_float4 // CHECK: %{{.*}} = call <4 x float> @llvm.sqrt.v4f32 // CHECK: ret <4 x float> %{{.*}} float4 test_sqrt_float4(float4 p0) { return sqrt(p0); } diff --git a/clang/test/CodeGenHLSL/builtins/trunc.hlsl b/clang/test/CodeGenHLSL/builtins/trunc.hlsl index 40b71f45a9ccb..3da12c88aa7fe 100644 --- a/clang/test/CodeGenHLSL/builtins/trunc.hlsl +++ b/clang/test/CodeGenHLSL/builtins/trunc.hlsl @@ -1,47 +1,46 @@ -// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple \ -// RUN: dxil-pc-shadermodel6.3-library %s -fnative-half-type \ -// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s \ -// RUN: --check-prefixes=CHECK,NATIVE_HALF -// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple \ -// RUN: dxil-pc-shadermodel6.3-library %s -emit-llvm -disable-llvm-passes \ -// RUN: -o - | FileCheck %s --check-prefixes=CHECK,NO_HALF - -// NATIVE_HALF: define noundef half @"?test_trunc_half +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \ +// RUN: -fnative-half-type -emit-llvm -disable-llvm-passes -o - | \ +// RUN: FileCheck %s --check-prefixes=CHECK,NATIVE_HALF +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \ +// RUN: -emit-llvm -disable-llvm-passes -o - | \ +// RUN: FileCheck %s --check-prefixes=CHECK,NO_HALF + +// NATIVE_HALF-LABEL: define noundef half @_Z15test_trunc_half // NATIVE_HALF: call half @llvm.trunc.f16( -// NO_HALF: define noundef float @"?test_trunc_half +// NO_HALF-LABEL: define noundef float @_Z15test_trunc_half // NO_HALF: call float @llvm.trunc.f32( half test_trunc_half(half p0) { return trunc(p0); } -// NATIVE_HALF: define noundef <2 x half> @"?test_trunc_half2 +// NATIVE_HALF-LABEL: define noundef <2 x half> @_Z16test_trunc_half2 // NATIVE_HALF: call <2 x half> @llvm.trunc.v2f16 -// NO_HALF: define noundef <2 x float> @"?test_trunc_half2 +// NO_HALF-LABEL: define noundef <2 x float> @_Z16test_trunc_half2 // NO_HALF: call <2 x float> @llvm.trunc.v2f32( half2 test_trunc_half2(half2 p0) { return trunc(p0); } -// NATIVE_HALF: define noundef <3 x half> @"?test_trunc_half3 +// NATIVE_HALF-LABEL: define noundef <3 x half> @_Z16test_trunc_half3 // NATIVE_HALF: call <3 x half> @llvm.trunc.v3f16 -// NO_HALF: define noundef <3 x float> @"?test_trunc_half3 +// NO_HALF-LABEL: define noundef <3 x float> @_Z16test_trunc_half3 // NO_HALF: call <3 x float> @llvm.trunc.v3f32( half3 test_trunc_half3(half3 p0) { return trunc(p0); } -// NATIVE_HALF: define noundef <4 x half> @"?test_trunc_half4 +// NATIVE_HALF-LABEL: define noundef <4 x half> @_Z16test_trunc_half4 // NATIVE_HALF: call <4 x half> @llvm.trunc.v4f16 -// NO_HALF: define noundef <4 x float> @"?test_trunc_half4 +// NO_HALF-LABEL: define noundef <4 x float> @_Z16test_trunc_half4 // NO_HALF: call <4 x float> @llvm.trunc.v4f32( half4 test_trunc_half4(half4 p0) { return trunc(p0); } -// CHECK: define noundef float @"?test_trunc_float +// CHECK-LABEL: define noundef float @_Z16test_trunc_float // CHECK: call float @llvm.trunc.f32( float test_trunc_float(float p0) { return trunc(p0); } -// CHECK: define noundef <2 x float> @"?test_trunc_float2 +// CHECK-LABEL: define noundef <2 x float> @_Z17test_trunc_float2 // CHECK: call <2 x float> @llvm.trunc.v2f32 float2 test_trunc_float2(float2 p0) { return trunc(p0); } -// CHECK: define noundef <3 x float> @"?test_trunc_float3 +// CHECK-LABEL: define noundef <3 x float> @_Z17test_trunc_float3 // CHECK: call <3 x float> @llvm.trunc.v3f32 float3 test_trunc_float3(float3 p0) { return trunc(p0); } -// CHECK: define noundef <4 x float> @"?test_trunc_float4 +// CHECK-LABEL: define noundef <4 x float> @_Z17test_trunc_float4 // CHECK: call <4 x float> @llvm.trunc.v4f32 float4 test_trunc_float4(float4 p0) { return trunc(p0); } diff --git a/clang/test/CodeGenHLSL/export.hlsl b/clang/test/CodeGenHLSL/export.hlsl index 63f9f9066f927..770618ff2e070 100644 --- a/clang/test/CodeGenHLSL/export.hlsl +++ b/clang/test/CodeGenHLSL/export.hlsl @@ -1,20 +1,19 @@ -// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \ -// RUN: dxil-pc-shadermodel6.3-library %s \ +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \ // RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s -// CHECK: define void @"?f1@@YAXXZ"() [[Attr:\#[0-9]+]] +// CHECK: define void @_Z2f1v() [[Attr:\#[0-9]+]] export void f1() { } -// CHECK: define void @"?f2@MyNamespace@@YAXXZ"() [[Attr]] +// CHECK: define void @_ZN11MyNamespace2f2Ev() [[Attr]] namespace MyNamespace { export void f2() { } } export { -// CHECK: define void @"?f3@@YAXXZ"() [[Attr]] -// CHECK: define void @"?f4@@YAXXZ"() [[Attr]] +// CHECK: define void @_Z2f3v() [[Attr]] +// CHECK: define void @_Z2f4v() [[Attr]] void f3() {} void f4() {} } diff --git a/clang/test/CodeGenHLSL/float3.hlsl b/clang/test/CodeGenHLSL/float3.hlsl index 63379349d9bd7..767720b049152 100644 --- a/clang/test/CodeGenHLSL/float3.hlsl +++ b/clang/test/CodeGenHLSL/float3.hlsl @@ -3,7 +3,7 @@ // RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s // Make sure float3 is not changed into float4. -// CHECK:<3 x float> @"?foo@@YAT?$__vector@M$02@__clang@@T12@@Z"(<3 x float> noundef %[[PARAM:[0-9a-zA-Z]+]]) +// CHECK:<3 x float> @_Z3fooDv3_f(<3 x float> noundef %[[PARAM:[0-9a-zA-Z]+]]) // CHECK:%[[A_ADDR:.+]] = alloca <3 x float>, align 16 // CHECK-NEXT:store <3 x float> %[[PARAM]], ptr %[[A_ADDR]], align 16 // CHECK-NEXT:%[[V:[0-9]+]] = load <3 x float>, ptr %[[A_ADDR]], align 16 diff --git a/clang/test/CodeGenHLSL/group_shared.hlsl b/clang/test/CodeGenHLSL/group_shared.hlsl index 48d14b2506fbc..4b2e2beba4f12 100644 --- a/clang/test/CodeGenHLSL/group_shared.hlsl +++ b/clang/test/CodeGenHLSL/group_shared.hlsl @@ -4,7 +4,7 @@ // RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s // Make sure groupshared translated into address space 3. -// CHECK:@"?a@@3PAMA" = addrspace(3) global [10 x float] +// CHECK:@a = addrspace(3) global [10 x float] groupshared float a[10]; diff --git a/clang/test/CodeGenHLSL/half.hlsl b/clang/test/CodeGenHLSL/half.hlsl index e83a6fc715b8a..08df6f31fd12f 100644 --- a/clang/test/CodeGenHLSL/half.hlsl +++ b/clang/test/CodeGenHLSL/half.hlsl @@ -8,12 +8,12 @@ // Make sure use float when not enable-16bit-types. -// FLOAT:define {{.*}}float @"?foo@@YA$halff@$halff@0@Z"(float{{[^,]+}}, float{{[^,)]+}}) +// FLOAT:define {{.*}}float @_Z3fooDhDh(float{{[^,]+}}, float{{[^,)]+}}) // FLOAT-NOT:half // FLOAT:ret float % // Make sure use half when enable-16bit-types. -// HALF:define {{.*}}half @"?foo@@YA$f16@$f16@0@Z"(half{{[^,]+}}, half{{[^,)]+}}) +// HALF:define {{.*}}half @_Z3fooDhDh(half{{[^,]+}}, half{{[^,)]+}}) // HALF-NOT:float // HALF:ret half % half foo(half a, half b) { diff --git a/clang/test/CodeGenHLSL/implicit-norecurse-attrib.hlsl b/clang/test/CodeGenHLSL/implicit-norecurse-attrib.hlsl index f72fe059cb576..5efecc1489afc 100644 --- a/clang/test/CodeGenHLSL/implicit-norecurse-attrib.hlsl +++ b/clang/test/CodeGenHLSL/implicit-norecurse-attrib.hlsl @@ -12,7 +12,7 @@ struct Node { }; // CHECK: Function Attrs:{{.*}}norecurse -// CHECK: define noundef i32 @"?Find@@YAIY0GE@UNode@@I@Z"(ptr noundef byval([100 x %struct.Node]) align 4 %SortedTree, i32 noundef %key) [[IntAttr:\#[0-9]+]] +// CHECK: define noundef i32 @_Z4FindA100_4Nodej(ptr noundef byval([100 x %struct.Node]) align 4 %SortedTree, i32 noundef %key) [[IntAttr:\#[0-9]+]] // CHECK: ret i32 // Find and return value corresponding to key in the SortedTree uint Find(Node SortedTree[MAX], uint key) { @@ -31,7 +31,7 @@ uint Find(Node SortedTree[MAX], uint key) { } // CHECK: Function Attrs:{{.*}}norecurse -// CHECK: define noundef i1 @"?InitTree@@YA_NY0GE@UNode@@V?$RWBuffer@T?$__vector@I$03@__clang@@@hlsl@@I@Z"(ptr noundef byval([100 x %struct.Node]) align 4 %tree, ptr noundef byval(%"class.hlsl::RWBuffer") align 16 %encodedTree, i32 noundef %maxDepth) [[ExtAttr:\#[0-9]+]] +// CHECK: define noundef i1 @_Z8InitTreeA100_4NodeN4hlsl8RWBufferIDv4_jEEj(ptr noundef byval([100 x %struct.Node]) align 4 %tree, ptr noundef byval(%"class.hlsl::RWBuffer") align 16 %encodedTree, i32 noundef %maxDepth) [[ExtAttr:\#[0-9]+]] // CHECK: ret i1 // Initialize tree with given buffer // Imagine the inout works @@ -52,7 +52,7 @@ RWBuffer gTree; // Mangled entry points are internal // CHECK: Function Attrs:{{.*}}norecurse -// CHECK: define internal void @"?main@@YAXI@Z"(i32 noundef %GI) [[IntAttr]] +// CHECK: define internal void @_Z4mainj(i32 noundef %GI) [[IntAttr]] // CHECK: ret void // Canonical entry points are external and shader attributed @@ -71,7 +71,7 @@ void main(uint GI : SV_GroupIndex) { // Mangled entry points are internal // CHECK: Function Attrs:{{.*}}norecurse -// CHECK: define internal void @"?defaultMain@@YAXXZ"() [[IntAttr]] +// CHECK: define internal void @_Z11defaultMainv() [[IntAttr]] // CHECK: ret void // Canonical entry points are external and shader attributed diff --git a/clang/test/CodeGenHLSL/inline-constructors.hlsl b/clang/test/CodeGenHLSL/inline-constructors.hlsl index 995878a9c0f79..b0d5a783fb372 100644 --- a/clang/test/CodeGenHLSL/inline-constructors.hlsl +++ b/clang/test/CodeGenHLSL/inline-constructors.hlsl @@ -49,7 +49,7 @@ void NionsDay(int hours) { // Verify constructor is emitted // NOINLINE-NEXT: call void @_GLOBAL__sub_I_inline_constructors.hlsl() // NOINLINE-NEXT: %0 = call i32 @llvm.dx.flattened.thread.id.in.group() -// NOINLINE-NEXT: call void @"?main@@YAXI@Z"(i32 %0) +// NOINLINE-NEXT: call void @_Z4mainj(i32 %0) // Verify inlining leaves only calls to "llvm." intrinsics // INLINE-NOT: call {{[^@]*}} @{{[^l][^l][^v][^m][^\.]}} // CHECK: ret void @@ -64,7 +64,7 @@ void main(unsigned GI : SV_GroupIndex) { // CHECK-NEXT: entry: // Verify constructor is emitted // NOINLINE-NEXT: call void @_GLOBAL__sub_I_inline_constructors.hlsl() -// NOINLINE-NEXT: call void @"?rainyMain@@YAXXZ"() +// NOINLINE-NEXT: call void @_Z9rainyMainv() // Verify inlining leaves only calls to "llvm." intrinsics // INLINE-NOT: call {{[^@]*}} @{{[^l][^l][^v][^m][^\.]}} // CHECK: ret void diff --git a/clang/test/CodeGenHLSL/inline-functions.hlsl b/clang/test/CodeGenHLSL/inline-functions.hlsl index 7dd905e966e06..fa9c88db26dfc 100644 --- a/clang/test/CodeGenHLSL/inline-functions.hlsl +++ b/clang/test/CodeGenHLSL/inline-functions.hlsl @@ -15,7 +15,7 @@ float nums[MAX]; // Verify that all functions have the alwaysinline attribute // NOINLINE: Function Attrs: alwaysinline -// NOINLINE: define void @"?swap@@YAXY0GE@III@Z"(ptr noundef byval([100 x i32]) align 4 %Buf, i32 noundef %ix1, i32 noundef %ix2) [[IntAttr:\#[0-9]+]] +// NOINLINE: define void @_Z4swapA100_jjj(ptr noundef byval([100 x i32]) align 4 %Buf, i32 noundef %ix1, i32 noundef %ix2) [[IntAttr:\#[0-9]+]] // NOINLINE: ret void // Swap the values of Buf at indices ix1 and ix2 void swap(unsigned Buf[MAX], unsigned ix1, unsigned ix2) { @@ -25,7 +25,7 @@ void swap(unsigned Buf[MAX], unsigned ix1, unsigned ix2) { } // NOINLINE: Function Attrs: alwaysinline -// NOINLINE: define void @"?BubbleSort@@YAXY0GE@II@Z"(ptr noundef byval([100 x i32]) align 4 %Buf, i32 noundef %size) [[IntAttr]] +// NOINLINE: define void @_Z10BubbleSortA100_jj(ptr noundef byval([100 x i32]) align 4 %Buf, i32 noundef %size) [[IntAttr]] // NOINLINE: ret void // Inefficiently sort Buf in place void BubbleSort(unsigned Buf[MAX], unsigned size) { @@ -43,7 +43,7 @@ void BubbleSort(unsigned Buf[MAX], unsigned size) { // Note ExtAttr is the inlined export set of attribs // CHECK: Function Attrs: alwaysinline -// CHECK: define noundef i32 @"?RemoveDupes@@YAIY0GE@II@Z"(ptr {{[a-z_ ]*}}noundef byval([100 x i32]) align 4 %Buf, i32 noundef %size) {{[a-z_ ]*}}[[ExtAttr:\#[0-9]+]] +// CHECK: define noundef i32 @_Z11RemoveDupesA100_jj(ptr {{[a-z_ ]*}}noundef byval([100 x i32]) align 4 %Buf, i32 noundef %size) {{[a-z_ ]*}}[[ExtAttr:\#[0-9]+]] // CHECK: ret i32 // Sort Buf and remove any duplicate values // returns the number of values left @@ -67,7 +67,7 @@ RWBuffer Indices; // because it has internal linkage from the start // Note main functions get the norecurse attrib, which IntAttr reflects // NOINLINE: Function Attrs: alwaysinline -// NOINLINE: define internal void @"?main@@YAXI@Z"(i32 noundef %GI) [[IntAttr]] +// NOINLINE: define internal void @_Z4mainj(i32 noundef %GI) [[IntAttr]] // NOINLINE: ret void // The unmangled version is not inlined, EntryAttr reflects that @@ -94,7 +94,7 @@ void main(unsigned int GI : SV_GroupIndex) { // because it has internal linkage from the start // Note main functions get the norecurse attrib, which IntAttr reflects // NOINLINE: Function Attrs: alwaysinline -// NOINLINE: define internal void @"?main10@@YAXXZ"() [[IntAttr]] +// NOINLINE: define internal void @_Z6main10v() [[IntAttr]] // NOINLINE: ret void // The unmangled version is not inlined, EntryAttr reflects that diff --git a/clang/test/CodeGenHLSL/semantics/GroupIndex-codegen.hlsl b/clang/test/CodeGenHLSL/semantics/GroupIndex-codegen.hlsl index 7e7ebe930bd96..ea358c411997d 100644 --- a/clang/test/CodeGenHLSL/semantics/GroupIndex-codegen.hlsl +++ b/clang/test/CodeGenHLSL/semantics/GroupIndex-codegen.hlsl @@ -13,7 +13,7 @@ void main(unsigned GI : SV_GroupIndex) { //CHECK: define void @main() #[[#ENTRY_ATTR:]] { //CHECK-NEXT: entry: //CHECK-NEXT: %0 = call i32 @llvm.dx.flattened.thread.id.in.group() -//CHECK-NEXT: call void @"?main@@YAXI@Z"(i32 %0) +//CHECK-NEXT: call void @_Z4mainj(i32 %0) //CHECK-NEXT: ret void //CHECK-NEXT: } diff --git a/clang/test/CodeGenHLSL/shift-mask.hlsl b/clang/test/CodeGenHLSL/shift-mask.hlsl index d046efaf9c1f9..7b3890ae560d2 100644 --- a/clang/test/CodeGenHLSL/shift-mask.hlsl +++ b/clang/test/CodeGenHLSL/shift-mask.hlsl @@ -1,12 +1,11 @@ -// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \ -// RUN: dxil-pc-shadermodel6.3-library %s \ +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \ // RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s int shl32(int V, int S) { return V << S; } -// CHECK: define noundef i32 @"?shl32{{[@$?.A-Za-z0-9_]+}}"(i32 noundef %V, i32 noundef %S) #0 { +// CHECK-LABEL: define noundef i32 @_Z5shl32ii(i32 noundef %V, i32 noundef %S) #0 { // CHECK-DAG: %[[Masked:.*]] = and i32 %{{.*}}, 31 // CHECK-DAG: %{{.*}} = shl i32 %{{.*}}, %[[Masked]] @@ -14,7 +13,7 @@ int shr32(int V, int S) { return V >> S; } -// CHECK: define noundef i32 @"?shr32{{[@$?.A-Za-z0-9_]+}}"(i32 noundef %V, i32 noundef %S) #0 { +// CHECK-LABEL: define noundef i32 @_Z5shr32ii(i32 noundef %V, i32 noundef %S) #0 { // CHECK-DAG: %[[Masked:.*]] = and i32 %{{.*}}, 31 // CHECK-DAG: %{{.*}} = ashr i32 %{{.*}}, %[[Masked]] @@ -22,7 +21,7 @@ int64_t shl64(int64_t V, int64_t S) { return V << S; } -// CHECK: define noundef i64 @"?shl64{{[@$?.A-Za-z0-9_]+}}"(i64 noundef %V, i64 noundef %S) #0 { +// CHECK-LABEL: define noundef i64 @_Z5shl64ll(i64 noundef %V, i64 noundef %S) #0 { // CHECK-DAG: %[[Masked:.*]] = and i64 %{{.*}}, 63 // CHECK-DAG: %{{.*}} = shl i64 %{{.*}}, %[[Masked]] @@ -30,6 +29,38 @@ int64_t shr64(int64_t V, int64_t S) { return V >> S; } -// CHECK: define noundef i64 @"?shr64{{[@$?.A-Za-z0-9_]+}}"(i64 noundef %V, i64 noundef %S) #0 { +// CHECK-LABEL: define noundef i64 @_Z5shr64ll(i64 noundef %V, i64 noundef %S) #0 { // CHECK-DAG: %[[Masked:.*]] = and i64 %{{.*}}, 63 // CHECK-DAG: %{{.*}} = ashr i64 %{{.*}}, %[[Masked]] + +uint shlu32(uint V, uint S) { + return V << S; +} + +// CHECK-LABEL: define noundef i32 @_Z6shlu32jj(i32 noundef %V, i32 noundef %S) #0 { +// CHECK-DAG: %[[Masked:.*]] = and i32 %{{.*}}, 31 +// CHECK-DAG: %{{.*}} = shl i32 %{{.*}}, %[[Masked]] + +uint shru32(uint V, uint S) { + return V >> S; +} + +// CHECK-LABEL: define noundef i32 @_Z6shru32jj(i32 noundef %V, i32 noundef %S) #0 { +// CHECK-DAG: %[[Masked:.*]] = and i32 %{{.*}}, 31 +// CHECK-DAG: %{{.*}} = lshr i32 %{{.*}}, %[[Masked]] + +uint64_t shlu64(uint64_t V, uint64_t S) { + return V << S; +} + +// CHECK-LABEL: define noundef i64 @_Z6shlu64mm(i64 noundef %V, i64 noundef %S) #0 { +// CHECK-DAG: %[[Masked:.*]] = and i64 %{{.*}}, 63 +// CHECK-DAG: %{{.*}} = shl i64 %{{.*}}, %[[Masked]] + +uint64_t shru64(uint64_t V, uint64_t S) { + return V >> S; +} + +// CHECK-LABEL: define noundef i64 @_Z6shru64mm(i64 noundef %V, i64 noundef %S) #0 { +// CHECK-DAG: %[[Masked:.*]] = and i64 %{{.*}}, 63 +// CHECK-DAG: %{{.*}} = lshr i64 %{{.*}}, %[[Masked]] diff --git a/clang/test/CodeGenHLSL/sret_output.hlsl b/clang/test/CodeGenHLSL/sret_output.hlsl index c44914f963a90..c324790ba016d 100644 --- a/clang/test/CodeGenHLSL/sret_output.hlsl +++ b/clang/test/CodeGenHLSL/sret_output.hlsl @@ -1,5 +1,4 @@ -// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple \ -// RUN: dxil-pc-shadermodel6.3-library %s \ +// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \ // RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s // FIXME: add semantic to a. @@ -10,10 +9,10 @@ struct S { // Make sure sret parameter is generated. -// CHECK:define internal void @"?ps_main@@YA?AUS@@XZ"(ptr dead_on_unwind noalias writable sret(%struct.S) align 4 %agg.result) +// CHECK:define internal void @_Z7ps_mainv(ptr dead_on_unwind noalias writable sret(%struct.S) align 4 %agg.result) // FIXME: change it to real value instead of poison value once semantic is add to a. // Make sure the function with sret is called. -// CHECK:call void @"?ps_main@@YA?AUS@@XZ"(ptr poison) +// CHECK:call void @_Z7ps_mainv(ptr poison) [shader("pixel")] S ps_main() { S s; diff --git a/clang/test/CodeGenHLSL/static-local-ctor.hlsl b/clang/test/CodeGenHLSL/static-local-ctor.hlsl index f55f6808672de..eba37e3f4c6b8 100644 --- a/clang/test/CodeGenHLSL/static-local-ctor.hlsl +++ b/clang/test/CodeGenHLSL/static-local-ctor.hlsl @@ -13,16 +13,16 @@ void InitBuf(RWBuffer buf) { } // CHECK-NOT: _Init_thread_epoch -// CHECK: define internal void @"?main@@YAXXZ" +// CHECK: define internal void @_Z4mainv // CHECK-NEXT: entry: // CHECK-NEXT: [[Tmp1:%.*]] = alloca %"class.hlsl::RWBuffer" -// CHECK-NEXT: [[Tmp2:%.*]] = load i32, ptr -// CHECK-NEXT: [[Tmp3:%.*]] = and i32 [[Tmp2]], 1 -// CHECK-NEXT: [[Tmp4:%.*]] = icmp eq i32 [[Tmp3]], 0 -// CHECK-NEXT: br i1 [[Tmp4]] +// CHECK-NEXT: [[Tmp2:%.*]] = load i8, ptr @_ZGVZ4mainvE5mybuf +// CHECK-NEXT: [[Tmp3:%.*]] = icmp eq i8 [[Tmp2]], 0 +// CHECK-NEXT: br i1 [[Tmp3]] // CHECK-NOT: _Init_thread_header -// CHECK: init: -// CHECK-NEXT: = or i32 [[Tmp2]], 1 +// CHECK: init.check: +// CHECK-NEXT: call void @_ZN4hlsl8RWBufferIiEC1Ev +// CHECK-NEXT: store i8 1, ptr @_ZGVZ4mainvE5mybuf // CHECK-NOT: _Init_thread_footer diff --git a/clang/test/CodeGenHLSL/static_global_and_function_in_cb.hlsl b/clang/test/CodeGenHLSL/static_global_and_function_in_cb.hlsl index eabd0faff6a87..f85bab2113170 100644 --- a/clang/test/CodeGenHLSL/static_global_and_function_in_cb.hlsl +++ b/clang/test/CodeGenHLSL/static_global_and_function_in_cb.hlsl @@ -1,15 +1,14 @@ -// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \ -// RUN: dxil-pc-shadermodel6.3-library %s \ +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \ // RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s // CHECK-DAG: @[[CB:.+]] = external constant { float } cbuffer A { float a; - // CHECK-DAG:@b = internal global float 3.000000e+00, align 4 + // CHECK-DAG:@_ZL1b = internal global float 3.000000e+00, align 4 static float b = 3; // CHECK:load float, ptr @[[CB]], align 4 - // CHECK:load float, ptr @b, align 4 + // CHECK:load float, ptr @_ZL1b, align 4 float foo() { return a + b; } } diff --git a/clang/test/CodeGenHLSL/this-assignment-overload.hlsl b/clang/test/CodeGenHLSL/this-assignment-overload.hlsl index f0affcb69a3fc..5a3bdc3d4d38e 100644 --- a/clang/test/CodeGenHLSL/this-assignment-overload.hlsl +++ b/clang/test/CodeGenHLSL/this-assignment-overload.hlsl @@ -25,7 +25,7 @@ void main() { } // This test makes a probably safe assumption that HLSL 202x includes operator overloading for assignment operators. -// CHECK: define linkonce_odr noundef i32 @"?getFirst@Pair@@QAAHXZ"(ptr noundef nonnull align 4 dereferenceable(8) %this) #0 align 2 { +// CHECK: define linkonce_odr noundef i32 @_ZN4Pair8getFirstEv(ptr noundef nonnull align 4 dereferenceable(8) %this) #0 align 2 { // CHECK-NEXT:entry: // CHECK-NEXT:%this.addr = alloca ptr, align 4 // CHECK-NEXT:%Another = alloca %struct.Pair, align 4 @@ -37,19 +37,19 @@ void main() { // CHECK-NEXT:%Second = getelementptr inbounds nuw %struct.Pair, ptr %Another, i32 0, i32 1 // CHECK-NEXT:store i32 10, ptr %Second, align 4 // CHECK-NEXT:call void @llvm.memcpy.p0.p0.i32(ptr align 4 %agg.tmp, ptr align 4 %Another, i32 8, i1 false) -// CHECK-NEXT:call void @"??4Pair@@QAAXU0@@Z"(ptr noundef nonnull align 4 dereferenceable(8) %this1, ptr noundef byval(%struct.Pair) align 4 %agg.tmp) +// CHECK-NEXT:call void @_ZN4PairaSES_(ptr noundef nonnull align 4 dereferenceable(8) %this1, ptr noundef byval(%struct.Pair) align 4 %agg.tmp) // CHECK-NEXT:%First2 = getelementptr inbounds nuw %struct.Pair, ptr %this1, i32 0, i32 0 // CHECK-NEXT:%0 = load i32, ptr %First2, align 4 // CHECK-NEXT:ret i32 %0 -// CHECK: define linkonce_odr noundef i32 @"?getSecond@Pair@@QAAHXZ"(ptr noundef nonnull align 4 dereferenceable(8) %this) #0 align 2 { +// CHECK: define linkonce_odr noundef i32 @_ZN4Pair9getSecondEv(ptr noundef nonnull align 4 dereferenceable(8) %this) #0 align 2 { // CHECK-NEXT:entry: // CHECK-NEXT:%this.addr = alloca ptr, align 4 // CHECK-NEXT:%agg.tmp = alloca %struct.Pair, align 4 // CHECK-NEXT:store ptr %this, ptr %this.addr, align 4 // CHECK-NEXT:%this1 = load ptr, ptr %this.addr, align 4 // CHECK-NEXT:call void @llvm.memset.p0.i32(ptr align 4 %agg.tmp, i8 0, i32 8, i1 false) -// CHECK-NEXT:call void @"??4Pair@@QAAXU0@@Z"(ptr noundef nonnull align 4 dereferenceable(8) %this1, ptr noundef byval(%struct.Pair) align 4 %agg.tmp) +// CHECK-NEXT:call void @_ZN4PairaSES_(ptr noundef nonnull align 4 dereferenceable(8) %this1, ptr noundef byval(%struct.Pair) align 4 %agg.tmp) // CHECK-NEXT:%Second = getelementptr inbounds nuw %struct.Pair, ptr %this1, i32 0, i32 1 // CHECK-NEXT:%0 = load i32, ptr %Second, align 4 // CHECK-NEXT:ret i32 %0 diff --git a/clang/test/CodeGenHLSL/this-assignment.hlsl b/clang/test/CodeGenHLSL/this-assignment.hlsl index 7408d199910e5..72bd2f8e70af8 100644 --- a/clang/test/CodeGenHLSL/this-assignment.hlsl +++ b/clang/test/CodeGenHLSL/this-assignment.hlsl @@ -1,5 +1,4 @@ // RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -emit-llvm -disable-llvm-passes -o - -hlsl-entry main %s | FileCheck %s -// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -std=hlsl202x -emit-llvm -disable-llvm-passes -o - -hlsl-entry main %s | FileCheck %s struct Pair { int First; @@ -40,7 +39,7 @@ void main() { // CHECK-NEXT:%Another = alloca %struct.Pair, align 4 // CHECK-NEXT:store ptr %this, ptr %this.addr, align 4 // CHECK-NEXT:%this1 = load ptr, ptr %this.addr, align 4 -// CHECK-NEXT:call void @llvm.memcpy.p0.p0.i32(ptr align 4 %Another, ptr align 4 @"__const.?getFirst@Pair@@QAAHXZ.Another", i32 8, i1 false) +// CHECK-NEXT:call void @llvm.memcpy.p0.p0.i32(ptr align 4 %Another, ptr align 4 @__const._ZN4Pair8getFirstEv.Another, i32 8, i1 false) // CHECK-NEXT:call void @llvm.memcpy.p0.p0.i32(ptr align 4 %this1, ptr align 4 %Another, i32 8, i1 false) // CHECK-NEXT:%First = getelementptr inbounds nuw %struct.Pair, ptr %this1, i32 0, i32 0 @@ -56,9 +55,7 @@ void main() { // CHECK-LABEL: define {{.*}}DoSilly // CHECK-NEXT:entry: -// CHECK-NEXT: [[ResPtr:%.*]] = alloca ptr // CHECK-NEXT: [[ThisPtrAddr:%.*]] = alloca ptr -// CHECK-NEXT: store ptr [[AggRes:%.*]], ptr [[ResPtr]] // CHECK-NEXT: store ptr {{.*}}, ptr [[ThisPtrAddr]] // CHECK-NEXT: [[ThisPtr:%.*]] = load ptr, ptr [[ThisPtrAddr]] // CHECK-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 4 [[ThisPtr]], ptr align 4 [[Obj:%.*]], i32 8, i1 false) @@ -66,4 +63,4 @@ void main() { // CHECK-NEXT: [[First:%.*]] = load i32, ptr [[FirstAddr]] // CHECK-NEXT: [[FirstPlusTwo:%.*]] = add nsw i32 [[First]], 2 // CHECK-NEXT: store i32 [[FirstPlusTwo]], ptr [[FirstAddr]] -// CHECK-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 4 [[AggRes]], ptr align 4 [[Obj]], i32 8, i1 false) +// CHECK-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 4 {{.*}}, ptr align 4 [[Obj]], i32 8, i1 false) diff --git a/clang/test/CodeGenHLSL/this-reference.hlsl b/clang/test/CodeGenHLSL/this-reference.hlsl index 032ee34ec65d3..66b79d4250012 100644 --- a/clang/test/CodeGenHLSL/this-reference.hlsl +++ b/clang/test/CodeGenHLSL/this-reference.hlsl @@ -21,10 +21,10 @@ void main() { } // This tests reference like `this` in HLSL - // CHECK: %call = call noundef i32 @"?getFirst@Pair@@QAAHXZ"(ptr noundef nonnull align 4 dereferenceable(8) %Vals) + // CHECK: %call = call noundef i32 @_ZN4Pair8getFirstEv(ptr noundef nonnull align 4 dereferenceable(8) %Vals) // CHECK-NEXT: %First = getelementptr inbounds nuw %struct.Pair, ptr %Vals, i32 0, i32 0 // CHECK-NEXT: store i32 %call, ptr %First, align 4 - // CHECK-NEXT: %call1 = call noundef float @"?getSecond@Pair@@QAAMXZ"(ptr noundef nonnull align 4 dereferenceable(8) %Vals) + // CHECK-NEXT: %call1 = call noundef float @_ZN4Pair9getSecondEv(ptr noundef nonnull align 4 dereferenceable(8) %Vals) // CHECK-NEXT: %Second = getelementptr inbounds nuw %struct.Pair, ptr %Vals, i32 0, i32 1 // CHECK: [[Pair:![0-9]+]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "Pair"