Add the 'target-cpu' and 'target-features' attributes to functions.
The back-end will use these values to reconfigure code generation for different
features.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175308 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/CodeGenCXX/2009-05-04-PureConstNounwind.cpp b/test/CodeGenCXX/2009-05-04-PureConstNounwind.cpp
index 7acc07d..da87121 100644
--- a/test/CodeGenCXX/2009-05-04-PureConstNounwind.cpp
+++ b/test/CodeGenCXX/2009-05-04-PureConstNounwind.cpp
@@ -3,7 +3,7 @@
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/test/CodeGenCXX/attr.cpp b/test/CodeGenCXX/attr.cpp
index a0dd748..b2ce4c8 100644
--- a/test/CodeGenCXX/attr.cpp
+++ b/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 @@
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/test/CodeGenCXX/cxx11-exception-spec.cpp b/test/CodeGenCXX/cxx11-exception-spec.cpp
index 194b80c..03b17d1 100644
--- a/test/CodeGenCXX/cxx11-exception-spec.cpp
+++ b/test/CodeGenCXX/cxx11-exception-spec.cpp
@@ -10,9 +10,9 @@
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()
@@ -21,9 +21,9 @@
// 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()
@@ -33,9 +33,9 @@
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
@@ -44,9 +44,9 @@
// 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
@@ -55,9 +55,9 @@
// 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
diff --git a/test/CodeGenCXX/debug-info-globalinit.cpp b/test/CodeGenCXX/debug-info-globalinit.cpp
index b3891c1..d9f5d05 100644
--- a/test/CodeGenCXX/debug-info-globalinit.cpp
+++ b/test/CodeGenCXX/debug-info-globalinit.cpp
@@ -17,7 +17,7 @@
// 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/test/CodeGenCXX/lambda-expressions.cpp b/test/CodeGenCXX/lambda-expressions.cpp
index ce20399..68ae68f 100644
--- a/test/CodeGenCXX/lambda-expressions.cpp
+++ b/test/CodeGenCXX/lambda-expressions.cpp
@@ -91,7 +91,7 @@
}();
}
-// 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