#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;
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<std::string>::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();
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
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{{.*}} {
// 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() {
}
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) {
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"
// 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);
// 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()
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
// 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, ...);
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();
}
// <rdar://problem/8087431>: 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;
}
// <rdar://problem/8283071>: 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;
}
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
// 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() { }
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
static void g() noexcept(sizeof(T) == 4);
};
-// CHECK: define {{.*}} @_Z1fIsEvv() {
+// CHECK: define {{.*}} @_Z1fIsEvv() "target-features"={{.*}} {
template<> void f<short>() { h(); }
-// CHECK: define {{.*}} @_Z1fIA2_sEvv() nounwind {
+// CHECK: define {{.*}} @_Z1fIA2_sEvv() nounwind "target-features"={{.*}} {
template<> void f<short[2]>() noexcept { h(); }
// CHECK: define {{.*}} @_ZN1SIsE1fEv()
// CHECK: define {{.*}} @_ZN1SIA2_sE1fEv() nounwind
template<> void S<short[2]>::f() noexcept { h(); }
-// CHECK: define {{.*}} @_Z1fIDsEvv() {
+// CHECK: define {{.*}} @_Z1fIDsEvv() "target-features"={{.*}} {
template void f<char16_t>();
-// CHECK: define {{.*}} @_Z1fIA2_DsEvv() nounwind {
+// CHECK: define {{.*}} @_Z1fIA2_DsEvv() nounwind "target-features"={{.*}} {
template void f<char16_t[2]>();
// CHECK: define {{.*}} @_ZN1SIDsE1fEv()
template void S<char16_t[2]>::f();
void h() {
- // CHECK: define {{.*}} @_Z1fIiEvv() nounwind {
+ // CHECK: define {{.*}} @_Z1fIiEvv() nounwind "target-features"={{.*}} {
f<int>();
- // CHECK: define {{.*}} @_Z1fIA2_iEvv() {
+ // CHECK: define {{.*}} @_Z1fIA2_iEvv() "target-features"={{.*}} {
f<int[2]>();
// CHECK: define {{.*}} @_ZN1SIiE1fEv() nounwind
// CHECK-NOT: nounwind
S<int[2]>::f();
- // CHECK: define {{.*}} @_Z1fIfEvv() nounwind {
+ // CHECK: define {{.*}} @_Z1fIfEvv() nounwind "target-features"={{.*}} {
void (*f1)() = &f<float>;
- // CHECK: define {{.*}} @_Z1fIdEvv() {
+ // CHECK: define {{.*}} @_Z1fIdEvv() "target-features"={{.*}} {
void (*f2)() = &f<double>;
// CHECK: define {{.*}} @_ZN1SIfE1fEv() nounwind
// CHECK-NOT: nounwind
void (*f4)() = &S<double>::f;
- // CHECK: define {{.*}} @_Z1fIA4_cEvv() nounwind {
+ // CHECK: define {{.*}} @_Z1fIA4_cEvv() nounwind "target-features"={{.*}} {
(void)&f<char[4]>;
- // CHECK: define {{.*}} @_Z1fIcEvv() {
+ // CHECK: define {{.*}} @_Z1fIcEvv() "target-features"={{.*}} {
(void)&f<char>;
// CHECK: define {{.*}} @_ZN1SIA4_cE1fEv() nounwind
// 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
//
}();
}
-// 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
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: }
}
// 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: }
@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
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
@class C;
-// CHECK: define void @test0() {
+// CHECK: define void @test0() "target-features"={{.*}} {
void test0() {
@try {
// CHECK: invoke void @opaque()
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