From 985d1c5d15d7a09d4cf7fdad1d502aadc1672fd6 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Fri, 15 Feb 2013 21:30:01 +0000 Subject: [PATCH] Add the 'target-cpu' and 'target-features' attributes to functions. The back-end will use these values to reconfigure code generation for different features. llvm-svn: 175308 --- clang/lib/CodeGen/CGCall.cpp | 13 +++++++++ clang/test/CodeGen/alias.c | 4 +-- clang/test/CodeGen/attr-naked.c | 4 +-- clang/test/CodeGen/attributes.c | 20 +++++++------- clang/test/CodeGen/incomplete-function-type-2.c | 2 +- clang/test/CodeGen/ms-declspecs.c | 4 +-- clang/test/CodeGen/ppc64-complex-parms.c | 32 +++++++++++----------- clang/test/CodeGen/ppc64-complex-return.c | 32 +++++++++++----------- clang/test/CodeGen/stack-protector.c | 6 ++-- clang/test/CodeGen/unwind-attr.c | 12 ++++---- .../CodeGenCXX/2009-05-04-PureConstNounwind.cpp | 2 +- clang/test/CodeGenCXX/attr.cpp | 10 +++---- clang/test/CodeGenCXX/cxx11-exception-spec.cpp | 20 +++++++------- clang/test/CodeGenCXX/debug-info-globalinit.cpp | 2 +- clang/test/CodeGenCXX/lambda-expressions.cpp | 2 +- clang/test/CodeGenObjC/arc-no-arc-exceptions.m | 8 +++--- clang/test/CodeGenObjC/arc.m | 4 +-- clang/test/CodeGenObjC/gnu-exceptions.m | 2 +- clang/test/CodeGenObjCXX/lambda-expressions.mm | 4 +-- 19 files changed, 98 insertions(+), 85 deletions(-) diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp index e7b543a..6072f60 100644 --- a/clang/lib/CodeGen/CGCall.cpp +++ b/clang/lib/CodeGen/CGCall.cpp @@ -26,6 +26,7 @@ #include "llvm/IR/Attributes.h" #include "llvm/IR/DataLayout.h" #include "llvm/IR/InlineAsm.h" +#include "llvm/MC/SubtargetFeature.h" #include "llvm/Support/CallSite.h" #include "llvm/Transforms/Utils/Local.h" using namespace clang; @@ -1015,6 +1016,18 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI, if (CodeGenOpts.NoImplicitFloat) FuncAttrs.addAttribute(llvm::Attribute::NoImplicitFloat); + if (!TargetOpts.CPU.empty()) + FuncAttrs.addAttribute("target-cpu", TargetOpts.CPU); + + if (TargetOpts.Features.size()) { + llvm::SubtargetFeatures Features; + for (std::vector::const_iterator + it = TargetOpts.Features.begin(), + ie = TargetOpts.Features.end(); it != ie; ++it) + Features.AddFeature(*it); + FuncAttrs.addAttribute("target-features", Features.getString()); + } + QualType RetTy = FI.getReturnType(); unsigned Index = 1; const ABIArgInfo &RetAI = FI.getReturnInfo(); diff --git a/clang/test/CodeGen/alias.c b/clang/test/CodeGen/alias.c index 0ccbca6..b90bcc2 100644 --- a/clang/test/CodeGen/alias.c +++ b/clang/test/CodeGen/alias.c @@ -14,7 +14,7 @@ void f0(void) { } extern void f1(void); extern void f1(void) __attribute((alias("f0"))); // CHECKBASIC: @f1 = alias void ()* @f0 -// CHECKBASIC: define void @f0() nounwind { +// CHECKBASIC: define void @f0() nounwind{{.*}} { // Make sure that aliases cause referenced values to be emitted. // PR3200 @@ -43,4 +43,4 @@ int outer(int a) { return inner(a); } int outer_weak(int a) { return inner_weak_a(a); } // CHECKCC: define arm_aapcs_vfpcc i32 @outer_weak(i32 %a) nounwind { // CHECKCC: call arm_aapcs_vfpcc i32 @inner_weak(i32 %{{.*}}) -// CHECKCC: define internal arm_aapcs_vfpcc i32 @inner_weak(i32 %a) nounwind { +// CHECKCC: define internal arm_aapcs_vfpcc i32 @inner_weak(i32 %a) nounwind{{.*}} { diff --git a/clang/test/CodeGen/attr-naked.c b/clang/test/CodeGen/attr-naked.c index 7b42ef8..a77e1ee 100644 --- a/clang/test/CodeGen/attr-naked.c +++ b/clang/test/CodeGen/attr-naked.c @@ -4,13 +4,13 @@ void t1() __attribute__((naked)); // Basic functionality check // (Note that naked needs to imply noinline to work properly.) -// CHECK: define void @t1() naked noinline nounwind { +// CHECK: define void @t1() naked noinline nounwind {{.*}} { void t1() { } // Make sure this doesn't explode in the verifier. // (It doesn't really make sense, but it isn't invalid.) -// CHECK: define void @t2() naked noinline nounwind { +// CHECK: define void @t2() naked noinline nounwind {{.*}} { __attribute((naked, always_inline)) void t2() { } diff --git a/clang/test/CodeGen/attributes.c b/clang/test/CodeGen/attributes.c index 00688dc..e21e768 100644 --- a/clang/test/CodeGen/attributes.c +++ b/clang/test/CodeGen/attributes.c @@ -36,39 +36,39 @@ int t17() { return t15() + t16; } -// CHECK: define void @t1() noreturn nounwind { +// CHECK: define void @t1() noreturn nounwind {{.*}} { void t1() __attribute__((noreturn)); void t1() { while (1) {} } -// CHECK: define void @t2() nounwind { +// CHECK: define void @t2() nounwind {{.*}} { void t2() __attribute__((nothrow)); void t2() {} -// CHECK: define weak void @t3() nounwind { +// CHECK: define weak void @t3() nounwind {{.*}} { void t3() __attribute__((weak)); void t3() {} -// CHECK: define hidden void @t4() nounwind { +// CHECK: define hidden void @t4() nounwind {{.*}} { void t4() __attribute__((visibility("hidden"))); void t4() {} -// CHECK: define void @t7() noreturn nounwind { +// CHECK: define void @t7() noreturn nounwind {{.*}} { void t7() __attribute__((noreturn, nothrow)); void t7() { while (1) {} } -// CHECK: define void @t10() nounwind section "SECT" { +// CHECK: define void @t10() nounwind {{.*}} section "SECT" { void t10(void) __attribute__((section("SECT"))); void t10(void) {} -// CHECK: define void @t11() nounwind section "SECT" { +// CHECK: define void @t11() nounwind {{.*}} section "SECT" { void __attribute__((section("SECT"))) t11(void) {} -// CHECK: define i32 @t19() nounwind { +// CHECK: define i32 @t19() nounwind {{.*}} { extern int t19(void) __attribute__((weak_import)); int t19(void) { return 10; } -// CHECK:define void @t20() nounwind { +// CHECK:define void @t20() nounwind {{.*}} { // CHECK: call void @abort() // CHECK-NEXT: unreachable void t20(void) { @@ -88,4 +88,4 @@ void t21(void) { void __attribute__((section(".foo"))) t22(void); void __attribute__((section(".bar"))) t22(void) {} -// CHECK: define void @t22() nounwind section ".bar" +// CHECK: define void @t22() nounwind {{.*}} section ".bar" diff --git a/clang/test/CodeGen/incomplete-function-type-2.c b/clang/test/CodeGen/incomplete-function-type-2.c index c6882f6..16c1d9b2 100644 --- a/clang/test/CodeGen/incomplete-function-type-2.c +++ b/clang/test/CodeGen/incomplete-function-type-2.c @@ -2,7 +2,7 @@ // PR14355: don't crash // Keep this test in its own file because CodeGenTypes has global state. -// CHECK: define void @test10_foo({}* %p1.coerce) nounwind { +// CHECK: define void @test10_foo({}* %p1.coerce) nounwind {{.*}} { struct test10_B; typedef struct test10_B test10_F3(double); void test10_foo(test10_F3 p1); diff --git a/clang/test/CodeGen/ms-declspecs.c b/clang/test/CodeGen/ms-declspecs.c index 7158e28..eb41d3b 100644 --- a/clang/test/CodeGen/ms-declspecs.c +++ b/clang/test/CodeGen/ms-declspecs.c @@ -8,14 +8,14 @@ union { struct S s; } u; // CHECK: @u = {{.*}}zeroinitializer, align 16 -// CHECK: define void @t3() naked noinline nounwind { +// CHECK: define void @t3() naked noinline nounwind {{.*}} { __declspec(naked) void t3() {} // CHECK: define void @t22() nounwind void __declspec(nothrow) t22(); void t22() {} -// CHECK: define void @t2() noinline nounwind { +// CHECK: define void @t2() noinline nounwind {{.*}} { __declspec(noinline) void t2() {} // CHECK: call void @f20_t() diff --git a/clang/test/CodeGen/ppc64-complex-parms.c b/clang/test/CodeGen/ppc64-complex-parms.c index 0c41d8c..b577695 100644 --- a/clang/test/CodeGen/ppc64-complex-parms.c +++ b/clang/test/CodeGen/ppc64-complex-parms.c @@ -9,55 +9,55 @@ float foo_float(_Complex float x) { return crealf(x); } -// CHECK: define float @foo_float(float {{[%A-Za-z0-9.]+}}, float {{[%A-Za-z0-9.]+}}) nounwind { +// CHECK: define float @foo_float(float {{[%A-Za-z0-9.]+}}, float {{[%A-Za-z0-9.]+}}) nounwind {{.*}} { double foo_double(_Complex double x) { return creal(x); } -// CHECK: define double @foo_double(double {{[%A-Za-z0-9.]+}}, double {{[%A-Za-z0-9.]+}}) nounwind { +// CHECK: define double @foo_double(double {{[%A-Za-z0-9.]+}}, double {{[%A-Za-z0-9.]+}}) nounwind {{.*}} { long double foo_long_double(_Complex long double x) { return creall(x); } -// CHECK: define ppc_fp128 @foo_long_double(ppc_fp128 {{[%A-Za-z0-9.]+}}, ppc_fp128 {{[%A-Za-z0-9.]+}}) nounwind { +// CHECK: define ppc_fp128 @foo_long_double(ppc_fp128 {{[%A-Za-z0-9.]+}}, ppc_fp128 {{[%A-Za-z0-9.]+}}) nounwind {{.*}} { int foo_int(_Complex int x) { return __real__ x; } -// CHECK: define signext i32 @foo_int(i32 {{[%A-Za-z0-9.]+}}, i32 {{[%A-Za-z0-9.]+}}) nounwind { +// CHECK: define signext i32 @foo_int(i32 {{[%A-Za-z0-9.]+}}, i32 {{[%A-Za-z0-9.]+}}) nounwind {{.*}} { short foo_short(_Complex short x) { return __real__ x; } -// CHECK: define signext i16 @foo_short(i16 {{[%A-Za-z0-9.]+}}, i16 {{[%A-Za-z0-9.]+}}) nounwind { +// CHECK: define signext i16 @foo_short(i16 {{[%A-Za-z0-9.]+}}, i16 {{[%A-Za-z0-9.]+}}) nounwind {{.*}} { signed char foo_char(_Complex signed char x) { return __real__ x; } -// CHECK: define signext i8 @foo_char(i8 {{[%A-Za-z0-9.]+}}, i8 {{[%A-Za-z0-9.]+}}) nounwind { +// CHECK: define signext i8 @foo_char(i8 {{[%A-Za-z0-9.]+}}, i8 {{[%A-Za-z0-9.]+}}) nounwind {{.*}} { long foo_long(_Complex long x) { return __real__ x; } -// CHECK: define i64 @foo_long(i64 {{[%A-Za-z0-9.]+}}, i64 {{[%A-Za-z0-9.]+}}) nounwind { +// CHECK: define i64 @foo_long(i64 {{[%A-Za-z0-9.]+}}, i64 {{[%A-Za-z0-9.]+}}) nounwind {{.*}} { long long foo_long_long(_Complex long long x) { return __real__ x; } -// CHECK: define i64 @foo_long_long(i64 {{[%A-Za-z0-9.]+}}, i64 {{[%A-Za-z0-9.]+}}) nounwind { +// CHECK: define i64 @foo_long_long(i64 {{[%A-Za-z0-9.]+}}, i64 {{[%A-Za-z0-9.]+}}) nounwind {{.*}} { void bar_float(void) { foo_float(2.0f - 2.5fi); } -// CHECK: define void @bar_float() nounwind { +// CHECK: define void @bar_float() nounwind {{.*}} { // CHECK: %[[VAR1:[A-Za-z0-9.]+]] = alloca { float, float }, align 4 // CHECK: %[[VAR2:[A-Za-z0-9.]+]] = getelementptr inbounds { float, float }* %[[VAR1]], i32 0, i32 0 // CHECK: %[[VAR3:[A-Za-z0-9.]+]] = getelementptr inbounds { float, float }* %[[VAR1]], i32 0, i32 1 @@ -73,7 +73,7 @@ void bar_double(void) { foo_double(2.0 - 2.5i); } -// CHECK: define void @bar_double() nounwind { +// CHECK: define void @bar_double() nounwind {{.*}} { // CHECK: %[[VAR11:[A-Za-z0-9.]+]] = alloca { double, double }, align 8 // CHECK: %[[VAR12:[A-Za-z0-9.]+]] = getelementptr inbounds { double, double }* %[[VAR11]], i32 0, i32 0 // CHECK: %[[VAR13:[A-Za-z0-9.]+]] = getelementptr inbounds { double, double }* %[[VAR11]], i32 0, i32 1 @@ -89,7 +89,7 @@ void bar_long_double(void) { foo_long_double(2.0L - 2.5Li); } -// CHECK: define void @bar_long_double() nounwind { +// CHECK: define void @bar_long_double() nounwind {{.*}} { // CHECK: %[[VAR21:[A-Za-z0-9.]+]] = alloca { ppc_fp128, ppc_fp128 }, align 16 // CHECK: %[[VAR22:[A-Za-z0-9.]+]] = getelementptr inbounds { ppc_fp128, ppc_fp128 }* %[[VAR21]], i32 0, i32 0 // CHECK: %[[VAR23:[A-Za-z0-9.]+]] = getelementptr inbounds { ppc_fp128, ppc_fp128 }* %[[VAR21]], i32 0, i32 1 @@ -105,7 +105,7 @@ void bar_int(void) { foo_int(2 - 3i); } -// CHECK: define void @bar_int() nounwind { +// CHECK: define void @bar_int() nounwind {{.*}} { // CHECK: %[[VAR31:[A-Za-z0-9.]+]] = alloca { i32, i32 }, align 4 // CHECK: %[[VAR32:[A-Za-z0-9.]+]] = getelementptr inbounds { i32, i32 }* %[[VAR31]], i32 0, i32 0 // CHECK: %[[VAR33:[A-Za-z0-9.]+]] = getelementptr inbounds { i32, i32 }* %[[VAR31]], i32 0, i32 1 @@ -121,7 +121,7 @@ void bar_short(void) { foo_short(2 - 3i); } -// CHECK: define void @bar_short() nounwind { +// CHECK: define void @bar_short() nounwind {{.*}} { // CHECK: %[[VAR41:[A-Za-z0-9.]+]] = alloca { i16, i16 }, align 2 // CHECK: %[[VAR42:[A-Za-z0-9.]+]] = getelementptr inbounds { i16, i16 }* %[[VAR41]], i32 0, i32 0 // CHECK: %[[VAR43:[A-Za-z0-9.]+]] = getelementptr inbounds { i16, i16 }* %[[VAR41]], i32 0, i32 1 @@ -137,7 +137,7 @@ void bar_char(void) { foo_char(2 - 3i); } -// CHECK: define void @bar_char() nounwind { +// CHECK: define void @bar_char() nounwind {{.*}} { // CHECK: %[[VAR51:[A-Za-z0-9.]+]] = alloca { i8, i8 }, align 1 // CHECK: %[[VAR52:[A-Za-z0-9.]+]] = getelementptr inbounds { i8, i8 }* %[[VAR51]], i32 0, i32 0 // CHECK: %[[VAR53:[A-Za-z0-9.]+]] = getelementptr inbounds { i8, i8 }* %[[VAR51]], i32 0, i32 1 @@ -153,7 +153,7 @@ void bar_long(void) { foo_long(2L - 3Li); } -// CHECK: define void @bar_long() nounwind { +// CHECK: define void @bar_long() nounwind {{.*}} { // CHECK: %[[VAR61:[A-Za-z0-9.]+]] = alloca { i64, i64 }, align 8 // CHECK: %[[VAR62:[A-Za-z0-9.]+]] = getelementptr inbounds { i64, i64 }* %[[VAR61]], i32 0, i32 0 // CHECK: %[[VAR63:[A-Za-z0-9.]+]] = getelementptr inbounds { i64, i64 }* %[[VAR61]], i32 0, i32 1 @@ -169,7 +169,7 @@ void bar_long_long(void) { foo_long_long(2LL - 3LLi); } -// CHECK: define void @bar_long_long() nounwind { +// CHECK: define void @bar_long_long() nounwind {{.*}} { // CHECK: %[[VAR71:[A-Za-z0-9.]+]] = alloca { i64, i64 }, align 8 // CHECK: %[[VAR72:[A-Za-z0-9.]+]] = getelementptr inbounds { i64, i64 }* %[[VAR71]], i32 0, i32 0 // CHECK: %[[VAR73:[A-Za-z0-9.]+]] = getelementptr inbounds { i64, i64 }* %[[VAR71]], i32 0, i32 1 diff --git a/clang/test/CodeGen/ppc64-complex-return.c b/clang/test/CodeGen/ppc64-complex-return.c index 42ab6cd..8972a0e 100644 --- a/clang/test/CodeGen/ppc64-complex-return.c +++ b/clang/test/CodeGen/ppc64-complex-return.c @@ -9,55 +9,55 @@ _Complex float foo_float(_Complex float x) { return x; } -// CHECK: define { float, float } @foo_float(float {{[%A-Za-z0-9.]+}}, float {{[%A-Za-z0-9.]+}}) nounwind { +// CHECK: define { float, float } @foo_float(float {{[%A-Za-z0-9.]+}}, float {{[%A-Za-z0-9.]+}}) nounwind {{.*}} { _Complex double foo_double(_Complex double x) { return x; } -// CHECK: define { double, double } @foo_double(double {{[%A-Za-z0-9.]+}}, double {{[%A-Za-z0-9.]+}}) nounwind { +// CHECK: define { double, double } @foo_double(double {{[%A-Za-z0-9.]+}}, double {{[%A-Za-z0-9.]+}}) nounwind {{.*}} { _Complex long double foo_long_double(_Complex long double x) { return x; } -// CHECK: define { ppc_fp128, ppc_fp128 } @foo_long_double(ppc_fp128 {{[%A-Za-z0-9.]+}}, ppc_fp128 {{[%A-Za-z0-9.]+}}) nounwind { +// CHECK: define { ppc_fp128, ppc_fp128 } @foo_long_double(ppc_fp128 {{[%A-Za-z0-9.]+}}, ppc_fp128 {{[%A-Za-z0-9.]+}}) nounwind {{.*}} { _Complex int foo_int(_Complex int x) { return x; } -// CHECK: define { i32, i32 } @foo_int(i32 {{[%A-Za-z0-9.]+}}, i32 {{[%A-Za-z0-9.]+}}) nounwind { +// CHECK: define { i32, i32 } @foo_int(i32 {{[%A-Za-z0-9.]+}}, i32 {{[%A-Za-z0-9.]+}}) nounwind {{.*}} { _Complex short foo_short(_Complex short x) { return x; } -// CHECK: define { i16, i16 } @foo_short(i16 {{[%A-Za-z0-9.]+}}, i16 {{[%A-Za-z0-9.]+}}) nounwind { +// CHECK: define { i16, i16 } @foo_short(i16 {{[%A-Za-z0-9.]+}}, i16 {{[%A-Za-z0-9.]+}}) nounwind {{.*}} { _Complex signed char foo_char(_Complex signed char x) { return x; } -// CHECK: define { i8, i8 } @foo_char(i8 {{[%A-Za-z0-9.]+}}, i8 {{[%A-Za-z0-9.]+}}) nounwind { +// CHECK: define { i8, i8 } @foo_char(i8 {{[%A-Za-z0-9.]+}}, i8 {{[%A-Za-z0-9.]+}}) nounwind {{.*}} { _Complex long foo_long(_Complex long x) { return x; } -// CHECK: define { i64, i64 } @foo_long(i64 {{[%A-Za-z0-9.]+}}, i64 {{[%A-Za-z0-9.]+}}) nounwind { +// CHECK: define { i64, i64 } @foo_long(i64 {{[%A-Za-z0-9.]+}}, i64 {{[%A-Za-z0-9.]+}}) nounwind {{.*}} { _Complex long long foo_long_long(_Complex long long x) { return x; } -// CHECK: define { i64, i64 } @foo_long_long(i64 {{[%A-Za-z0-9.]+}}, i64 {{[%A-Za-z0-9.]+}}) nounwind { +// CHECK: define { i64, i64 } @foo_long_long(i64 {{[%A-Za-z0-9.]+}}, i64 {{[%A-Za-z0-9.]+}}) nounwind {{.*}} { float bar_float(void) { return crealf(foo_float(2.0f - 2.5fi)); } -// CHECK: define float @bar_float() nounwind { +// CHECK: define float @bar_float() nounwind {{.*}} { // CHECK: [[VAR1:[%A-Za-z0-9.]+]] = call { float, float } @foo_float // CHECK: extractvalue { float, float } [[VAR1]], 0 // CHECK: extractvalue { float, float } [[VAR1]], 1 @@ -66,7 +66,7 @@ double bar_double(void) { return creal(foo_double(2.0 - 2.5i)); } -// CHECK: define double @bar_double() nounwind { +// CHECK: define double @bar_double() nounwind {{.*}} { // CHECK: [[VAR2:[%A-Za-z0-9.]+]] = call { double, double } @foo_double // CHECK: extractvalue { double, double } [[VAR2]], 0 // CHECK: extractvalue { double, double } [[VAR2]], 1 @@ -75,7 +75,7 @@ long double bar_long_double(void) { return creall(foo_long_double(2.0L - 2.5Li)); } -// CHECK: define ppc_fp128 @bar_long_double() nounwind { +// CHECK: define ppc_fp128 @bar_long_double() nounwind {{.*}} { // CHECK: [[VAR3:[%A-Za-z0-9.]+]] = call { ppc_fp128, ppc_fp128 } @foo_long_double // CHECK: extractvalue { ppc_fp128, ppc_fp128 } [[VAR3]], 0 // CHECK: extractvalue { ppc_fp128, ppc_fp128 } [[VAR3]], 1 @@ -84,7 +84,7 @@ int bar_int(void) { return __real__(foo_int(2 - 3i)); } -// CHECK: define signext i32 @bar_int() nounwind { +// CHECK: define signext i32 @bar_int() nounwind {{.*}} { // CHECK: [[VAR4:[%A-Za-z0-9.]+]] = call { i32, i32 } @foo_int // CHECK: extractvalue { i32, i32 } [[VAR4]], 0 // CHECK: extractvalue { i32, i32 } [[VAR4]], 1 @@ -93,7 +93,7 @@ short bar_short(void) { return __real__(foo_short(2 - 3i)); } -// CHECK: define signext i16 @bar_short() nounwind { +// CHECK: define signext i16 @bar_short() nounwind {{.*}} { // CHECK: [[VAR5:[%A-Za-z0-9.]+]] = call { i16, i16 } @foo_short // CHECK: extractvalue { i16, i16 } [[VAR5]], 0 // CHECK: extractvalue { i16, i16 } [[VAR5]], 1 @@ -102,7 +102,7 @@ signed char bar_char(void) { return __real__(foo_char(2 - 3i)); } -// CHECK: define signext i8 @bar_char() nounwind { +// CHECK: define signext i8 @bar_char() nounwind {{.*}} { // CHECK: [[VAR6:[%A-Za-z0-9.]+]] = call { i8, i8 } @foo_char // CHECK: extractvalue { i8, i8 } [[VAR6]], 0 // CHECK: extractvalue { i8, i8 } [[VAR6]], 1 @@ -111,7 +111,7 @@ long bar_long(void) { return __real__(foo_long(2L - 3Li)); } -// CHECK: define i64 @bar_long() nounwind { +// CHECK: define i64 @bar_long() nounwind {{.*}} { // CHECK: [[VAR7:[%A-Za-z0-9.]+]] = call { i64, i64 } @foo_long // CHECK: extractvalue { i64, i64 } [[VAR7]], 0 // CHECK: extractvalue { i64, i64 } [[VAR7]], 1 @@ -120,7 +120,7 @@ long long bar_long_long(void) { return __real__(foo_long_long(2LL - 3LLi)); } -// CHECK: define i64 @bar_long_long() nounwind { +// CHECK: define i64 @bar_long_long() nounwind {{.*}} { // CHECK: [[VAR8:[%A-Za-z0-9.]+]] = call { i64, i64 } @foo_long_long // CHECK: extractvalue { i64, i64 } [[VAR8]], 0 // CHECK: extractvalue { i64, i64 } [[VAR8]], 1 diff --git a/clang/test/CodeGen/stack-protector.c b/clang/test/CodeGen/stack-protector.c index eb4cea2..0db2844 100644 --- a/clang/test/CodeGen/stack-protector.c +++ b/clang/test/CodeGen/stack-protector.c @@ -1,9 +1,9 @@ // RUN: %clang_cc1 -emit-llvm -o - %s -stack-protector 0 | FileCheck -check-prefix=NOSSP %s -// NOSSP: define void @test1(i8* %msg) nounwind { +// NOSSP: define void @test1(i8* %msg) nounwind {{.*}} { // RUN: %clang_cc1 -emit-llvm -o - %s -stack-protector 1 | FileCheck -check-prefix=WITHSSP %s -// WITHSSP: define void @test1(i8* %msg) nounwind ssp { +// WITHSSP: define void @test1(i8* %msg) nounwind ssp {{.*}} { // RUN: %clang_cc1 -emit-llvm -o - %s -stack-protector 2 | FileCheck -check-prefix=SSPREQ %s -// SSPREQ: define void @test1(i8* %msg) nounwind sspreq { +// SSPREQ: define void @test1(i8* %msg) nounwind sspreq {{.*}} { int printf(const char * _Format, ...); diff --git a/clang/test/CodeGen/unwind-attr.c b/clang/test/CodeGen/unwind-attr.c index 7a79cb6..3241b0d 100644 --- a/clang/test/CodeGen/unwind-attr.c +++ b/clang/test/CodeGen/unwind-attr.c @@ -3,22 +3,22 @@ int opaque(); -// CHECK: define [[INT:i.*]] @test0() { -// CHECK-NOEXC: define [[INT:i.*]] @test0() nounwind { +// CHECK: define [[INT:i.*]] @test0() "target-features"={{.*}} { +// CHECK-NOEXC: define [[INT:i.*]] @test0() nounwind{{.*}} { int test0(void) { return opaque(); } // : locally infer nounwind at -O0 -// CHECK: define [[INT:i.*]] @test1() nounwind { -// CHECK-NOEXC: define [[INT:i.*]] @test1() nounwind { +// CHECK: define [[INT:i.*]] @test1() nounwind{{.*}} { +// CHECK-NOEXC: define [[INT:i.*]] @test1() nounwind{{.*}} { int test1(void) { return 0; } // : not for weak functions -// CHECK: define weak [[INT:i.*]] @test2() { -// CHECK-NOEXC: define weak [[INT:i.*]] @test2() nounwind { +// CHECK: define weak [[INT:i.*]] @test2() "target-features"={{.*}} { +// CHECK-NOEXC: define weak [[INT:i.*]] @test2() nounwind{{.*}} { __attribute__((weak)) int test2(void) { return 0; } diff --git a/clang/test/CodeGenCXX/2009-05-04-PureConstNounwind.cpp b/clang/test/CodeGenCXX/2009-05-04-PureConstNounwind.cpp index 7acc07d..da87121 100644 --- a/clang/test/CodeGenCXX/2009-05-04-PureConstNounwind.cpp +++ b/clang/test/CodeGenCXX/2009-05-04-PureConstNounwind.cpp @@ -3,7 +3,7 @@ int c(void) __attribute__((const)); int p(void) __attribute__((pure)); int t(void); -// CHECK: define i32 @_Z1fv() { +// CHECK: define i32 @_Z1fv() {{.*}} { int f(void) { // CHECK: call i32 @_Z1cv() nounwind readnone // CHECK: call i32 @_Z1pv() nounwind readonly diff --git a/clang/test/CodeGenCXX/attr.cpp b/clang/test/CodeGenCXX/attr.cpp index a0dd748..b2ce4c8 100644 --- a/clang/test/CodeGenCXX/attr.cpp +++ b/clang/test/CodeGenCXX/attr.cpp @@ -2,7 +2,7 @@ // CHECK: @test2 = alias i32 ()* @_Z5test1v -// CHECK: define i32 @_Z3foov() nounwind align 1024 +// CHECK: define i32 @_Z3foov() nounwind {{.*}} align 1024 int foo() __attribute__((aligned(1024))); int foo() { } @@ -13,16 +13,16 @@ class C { void bar4() __attribute__((aligned(1024))); } c; -// CHECK: define void @_ZN1C4bar1Ev(%class.C* %this) unnamed_addr nounwind align 2 +// CHECK: define void @_ZN1C4bar1Ev(%class.C* %this) unnamed_addr nounwind {{.*}} align 2 void C::bar1() { } -// CHECK: define void @_ZN1C4bar2Ev(%class.C* %this) unnamed_addr nounwind align 2 +// CHECK: define void @_ZN1C4bar2Ev(%class.C* %this) unnamed_addr nounwind {{.*}} align 2 void C::bar2() { } -// CHECK: define void @_ZN1C4bar3Ev(%class.C* %this) unnamed_addr nounwind align 1024 +// CHECK: define void @_ZN1C4bar3Ev(%class.C* %this) unnamed_addr nounwind {{.*}} align 1024 void C::bar3() { } -// CHECK: define void @_ZN1C4bar4Ev(%class.C* %this) nounwind align 1024 +// CHECK: define void @_ZN1C4bar4Ev(%class.C* %this) nounwind {{.*}} align 1024 void C::bar4() { } // PR6635 diff --git a/clang/test/CodeGenCXX/cxx11-exception-spec.cpp b/clang/test/CodeGenCXX/cxx11-exception-spec.cpp index 194b80c..03b17d1 100644 --- a/clang/test/CodeGenCXX/cxx11-exception-spec.cpp +++ b/clang/test/CodeGenCXX/cxx11-exception-spec.cpp @@ -10,9 +10,9 @@ template struct S { static void g() noexcept(sizeof(T) == 4); }; -// CHECK: define {{.*}} @_Z1fIsEvv() { +// CHECK: define {{.*}} @_Z1fIsEvv() "target-features"={{.*}} { template<> void f() { h(); } -// CHECK: define {{.*}} @_Z1fIA2_sEvv() nounwind { +// CHECK: define {{.*}} @_Z1fIA2_sEvv() nounwind "target-features"={{.*}} { template<> void f() noexcept { h(); } // CHECK: define {{.*}} @_ZN1SIsE1fEv() @@ -21,9 +21,9 @@ template<> void S::f() { h(); } // CHECK: define {{.*}} @_ZN1SIA2_sE1fEv() nounwind template<> void S::f() noexcept { h(); } -// CHECK: define {{.*}} @_Z1fIDsEvv() { +// CHECK: define {{.*}} @_Z1fIDsEvv() "target-features"={{.*}} { template void f(); -// CHECK: define {{.*}} @_Z1fIA2_DsEvv() nounwind { +// CHECK: define {{.*}} @_Z1fIA2_DsEvv() nounwind "target-features"={{.*}} { template void f(); // CHECK: define {{.*}} @_ZN1SIDsE1fEv() @@ -33,9 +33,9 @@ template void S::f(); template void S::f(); void h() { - // CHECK: define {{.*}} @_Z1fIiEvv() nounwind { + // CHECK: define {{.*}} @_Z1fIiEvv() nounwind "target-features"={{.*}} { f(); - // CHECK: define {{.*}} @_Z1fIA2_iEvv() { + // CHECK: define {{.*}} @_Z1fIA2_iEvv() "target-features"={{.*}} { f(); // CHECK: define {{.*}} @_ZN1SIiE1fEv() nounwind @@ -44,9 +44,9 @@ void h() { // CHECK-NOT: nounwind S::f(); - // CHECK: define {{.*}} @_Z1fIfEvv() nounwind { + // CHECK: define {{.*}} @_Z1fIfEvv() nounwind "target-features"={{.*}} { void (*f1)() = &f; - // CHECK: define {{.*}} @_Z1fIdEvv() { + // CHECK: define {{.*}} @_Z1fIdEvv() "target-features"={{.*}} { void (*f2)() = &f; // CHECK: define {{.*}} @_ZN1SIfE1fEv() nounwind @@ -55,9 +55,9 @@ void h() { // CHECK-NOT: nounwind void (*f4)() = &S::f; - // CHECK: define {{.*}} @_Z1fIA4_cEvv() nounwind { + // CHECK: define {{.*}} @_Z1fIA4_cEvv() nounwind "target-features"={{.*}} { (void)&f; - // CHECK: define {{.*}} @_Z1fIcEvv() { + // CHECK: define {{.*}} @_Z1fIcEvv() "target-features"={{.*}} { (void)&f; // CHECK: define {{.*}} @_ZN1SIA4_cE1fEv() nounwind diff --git a/clang/test/CodeGenCXX/debug-info-globalinit.cpp b/clang/test/CodeGenCXX/debug-info-globalinit.cpp index b3891c1..d9f5d05 100644 --- a/clang/test/CodeGenCXX/debug-info-globalinit.cpp +++ b/clang/test/CodeGenCXX/debug-info-globalinit.cpp @@ -17,7 +17,7 @@ int main(void) {} // CHECK: define internal void @__cxx_global_var_init() // CHECK-NOT: __cxx_global_var_init -// CHECK: %[[C0:.+]] = call i32 @_Z4testv(), !dbg ![[LINE:.*]] +// CHECK: %[[C0:.+]] = call i32 @_Z4testv() "target-features"={{.*}}, !dbg ![[LINE:.*]] // CHECK-NOT: __cxx_global_var_init // CHECK: store i32 %[[C0]], i32* @_ZL1i, align 4, !dbg // diff --git a/clang/test/CodeGenCXX/lambda-expressions.cpp b/clang/test/CodeGenCXX/lambda-expressions.cpp index ce20399..68ae68f 100644 --- a/clang/test/CodeGenCXX/lambda-expressions.cpp +++ b/clang/test/CodeGenCXX/lambda-expressions.cpp @@ -91,7 +91,7 @@ void staticarrayref(){ }(); } -// CHECK: define internal void @"_ZZ1hvEN3$_88__invokeEv"(%struct.A* noalias sret %agg.result) +// CHECK: define internal void @"_ZZ1hvEN3$_88__invokeEv"(%struct.A* noalias sret %agg.result) {{.*}} { // CHECK-NOT: = // CHECK: call void @"_ZZ1hvENK3$_8clEv"(%struct.A* sret %agg.result, // CHECK-NEXT: ret void diff --git a/clang/test/CodeGenObjC/arc-no-arc-exceptions.m b/clang/test/CodeGenObjC/arc-no-arc-exceptions.m index 7ae061f..0acd095 100644 --- a/clang/test/CodeGenObjC/arc-no-arc-exceptions.m +++ b/clang/test/CodeGenObjC/arc-no-arc-exceptions.m @@ -9,8 +9,8 @@ void thrower(void); void not(void) __attribute__((nothrow)); // CHECK: define void @test0( -// CHECK: call void @thrower(), !clang.arc.no_objc_arc_exceptions ! -// CHECK: call void @not() nounwind, !clang.arc.no_objc_arc_exceptions ! +// CHECK: call void @thrower() "target-features"={{.*}}, !clang.arc.no_objc_arc_exceptions ! +// CHECK: call void @not() nounwind "target-features"={{.*}}, !clang.arc.no_objc_arc_exceptions ! // NO-METADATA: define void @test0( // NO-METADATA-NOT: !clang.arc.no_objc_arc_exceptions // NO-METADATA: } @@ -20,8 +20,8 @@ void test0(void) { } // CHECK: define void @test1( -// CHECK: call void @thrower(), !clang.arc.no_objc_arc_exceptions ! -// CHECK: call void @not() nounwind, !clang.arc.no_objc_arc_exceptions ! +// CHECK: call void @thrower() "target-features"={{.*}}, !clang.arc.no_objc_arc_exceptions ! +// CHECK: call void @not() nounwind "target-features"={{.*}}, !clang.arc.no_objc_arc_exceptions ! // NO-METADATA: define void @test1( // NO-METADATA-NOT: !clang.arc.no_objc_arc_exceptions // NO-METADATA: } diff --git a/clang/test/CodeGenObjC/arc.m b/clang/test/CodeGenObjC/arc.m index 4254aca..ad495ba 100644 --- a/clang/test/CodeGenObjC/arc.m +++ b/clang/test/CodeGenObjC/arc.m @@ -676,7 +676,7 @@ void test21(unsigned n) { @implementation Test29 static id _test29_allocator = 0; - (id) init { -// CHECK: define internal i8* @"\01-[Test29 init]"([[TEST29:%.*]]* {{%.*}}, +// CHECK: define internal i8* @"\01-[Test29 init]"([[TEST29:%[^*]*]]* {{%.*}}, // CHECK: [[SELF:%.*]] = alloca [[TEST29]]*, align 8 // CHECK-NEXT: [[CMD:%.*]] = alloca i8*, align 8 // CHECK-NEXT: [[CLEANUP:%.*]] = alloca i32 @@ -786,7 +786,7 @@ typedef struct Test30_helper Test30_helper; char *helper; } - (id) init { -// CHECK: define internal i8* @"\01-[Test30 init]"([[TEST30:%.*]]* {{%.*}}, +// CHECK: define internal i8* @"\01-[Test30 init]"([[TEST30:%[^*]*]]* {{%.*}}, // CHECK: [[RET:%.*]] = alloca [[TEST30]]* // CHECK-NEXT: alloca i8* // CHECK-NEXT: alloca i32 diff --git a/clang/test/CodeGenObjC/gnu-exceptions.m b/clang/test/CodeGenObjC/gnu-exceptions.m index 4a046e2..604bcf2 100644 --- a/clang/test/CodeGenObjC/gnu-exceptions.m +++ b/clang/test/CodeGenObjC/gnu-exceptions.m @@ -6,7 +6,7 @@ void log(int i); @class C; -// CHECK: define void @test0() { +// CHECK: define void @test0() "target-features"={{.*}} { void test0() { @try { // CHECK: invoke void @opaque() diff --git a/clang/test/CodeGenObjCXX/lambda-expressions.mm b/clang/test/CodeGenObjCXX/lambda-expressions.mm index ec3eb1f..6361d65 100644 --- a/clang/test/CodeGenObjCXX/lambda-expressions.mm +++ b/clang/test/CodeGenObjCXX/lambda-expressions.mm @@ -25,13 +25,13 @@ typedef int (^fp)(); fp global; void f2() { global = []{ return 3; }; } -// MRC: define void @_Z2f2v() nounwind { +// MRC: define void @_Z2f2v() nounwind "target-features"={{.*}} { // MRC: store i8* bitcast (i32 (i8*)* @___Z2f2v_block_invoke to i8*), // MRC-NOT: call // MRC: ret void // ("global" contains a dangling pointer after this function runs.) -// ARC: define void @_Z2f2v() nounwind { +// ARC: define void @_Z2f2v() nounwind "target-features"={{.*}} { // ARC: store i8* bitcast (i32 (i8*)* @___Z2f2v_block_invoke to i8*), // ARC: call i8* @objc_retainBlock // ARC: call void @objc_release -- 2.7.4