diff options
Diffstat (limited to 'clang/test/CodeGenCXX')
21 files changed, 155 insertions, 71 deletions
diff --git a/clang/test/CodeGenCXX/2009-05-04-PureConstNounwind.cpp b/clang/test/CodeGenCXX/2009-05-04-PureConstNounwind.cpp index da8712180ef..35fed7bf0d4 100644 --- a/clang/test/CodeGenCXX/2009-05-04-PureConstNounwind.cpp +++ b/clang/test/CodeGenCXX/2009-05-04-PureConstNounwind.cpp @@ -10,6 +10,10 @@ int f(void) { return c() + p() + t(); } -// CHECK: declare i32 @_Z1cv() nounwind readnone -// CHECK: declare i32 @_Z1pv() nounwind readonly -// CHECK-NOT: declare i32 @_Z1tv() nounwind +// CHECK: declare i32 @_Z1cv() #1 +// CHECK: declare i32 @_Z1pv() #2 +// CHECK: declare i32 @_Z1tv() #0 + +// CHECK: attributes #0 = { "target-features"={{.*}} } +// CHECK: attributes #1 = { nounwind readnone "target-features"={{.*}} } +// CHECK: attributes #2 = { nounwind readonly "target-features"={{.*}} } diff --git a/clang/test/CodeGenCXX/attr.cpp b/clang/test/CodeGenCXX/attr.cpp index b2ce4c8d252..238019ceb63 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() #0 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 #0 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 #0 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 #0 align 1024 void C::bar3() { } -// CHECK: define void @_ZN1C4bar4Ev(%class.C* %this) nounwind {{.*}} align 1024 +// CHECK: define void @_ZN1C4bar4Ev(%class.C* %this) #0 align 1024 void C::bar4() { } // PR6635 @@ -30,3 +30,8 @@ void C::bar4() { } int test1() { return 10; } // CHECK at top of file extern "C" int test2() __attribute__((alias("_Z5test1v"))); + +// CHECK: attributes #0 = { nounwind "target-features"={{.*}} } +// CHECK: attributes #1 = { noreturn nounwind } +// CHECK: attributes #2 = { nounwind } +// CHECK: attributes #3 = { inlinehint nounwind "target-features"={{.*}} } diff --git a/clang/test/CodeGenCXX/cxx11-exception-spec.cpp b/clang/test/CodeGenCXX/cxx11-exception-spec.cpp index 03b17d1b2ba..3942ab79aa1 100644 --- a/clang/test/CodeGenCXX/cxx11-exception-spec.cpp +++ b/clang/test/CodeGenCXX/cxx11-exception-spec.cpp @@ -10,99 +10,99 @@ template<typename T> struct S { static void g() noexcept(sizeof(T) == 4); }; -// CHECK: define {{.*}} @_Z1fIsEvv() "target-features"={{.*}} { +// CHECK: define {{.*}} @_Z1fIsEvv() #0 { template<> void f<short>() { h(); } -// CHECK: define {{.*}} @_Z1fIA2_sEvv() nounwind "target-features"={{.*}} { +// CHECK: define {{.*}} @_Z1fIA2_sEvv() #1 { template<> void f<short[2]>() noexcept { h(); } // CHECK: define {{.*}} @_ZN1SIsE1fEv() -// CHECK-NOT: nounwind +// CHECK-NOT: #1 template<> void S<short>::f() { h(); } -// CHECK: define {{.*}} @_ZN1SIA2_sE1fEv() nounwind +// CHECK: define {{.*}} @_ZN1SIA2_sE1fEv() #1 template<> void S<short[2]>::f() noexcept { h(); } -// CHECK: define {{.*}} @_Z1fIDsEvv() "target-features"={{.*}} { +// CHECK: define {{.*}} @_Z1fIDsEvv() #0 { template void f<char16_t>(); -// CHECK: define {{.*}} @_Z1fIA2_DsEvv() nounwind "target-features"={{.*}} { +// CHECK: define {{.*}} @_Z1fIA2_DsEvv() #1 { template void f<char16_t[2]>(); // CHECK: define {{.*}} @_ZN1SIDsE1fEv() -// CHECK-NOT: nounwind +// CHECK-NOT: #1 template void S<char16_t>::f(); -// CHECK: define {{.*}} @_ZN1SIA2_DsE1fEv() nounwind +// CHECK: define {{.*}} @_ZN1SIA2_DsE1fEv() #1 template void S<char16_t[2]>::f(); void h() { - // CHECK: define {{.*}} @_Z1fIiEvv() nounwind "target-features"={{.*}} { + // CHECK: define {{.*}} @_Z1fIiEvv() #1 { f<int>(); - // CHECK: define {{.*}} @_Z1fIA2_iEvv() "target-features"={{.*}} { + // CHECK: define {{.*}} @_Z1fIA2_iEvv() #0 { f<int[2]>(); - // CHECK: define {{.*}} @_ZN1SIiE1fEv() nounwind + // CHECK: define {{.*}} @_ZN1SIiE1fEv() #1 S<int>::f(); // CHECK: define {{.*}} @_ZN1SIA2_iE1fEv() - // CHECK-NOT: nounwind + // CHECK-NOT: #1 S<int[2]>::f(); - // CHECK: define {{.*}} @_Z1fIfEvv() nounwind "target-features"={{.*}} { + // CHECK: define {{.*}} @_Z1fIfEvv() #1 { void (*f1)() = &f<float>; - // CHECK: define {{.*}} @_Z1fIdEvv() "target-features"={{.*}} { + // CHECK: define {{.*}} @_Z1fIdEvv() #0 { void (*f2)() = &f<double>; - // CHECK: define {{.*}} @_ZN1SIfE1fEv() nounwind + // CHECK: define {{.*}} @_ZN1SIfE1fEv() #1 void (*f3)() = &S<float>::f; // CHECK: define {{.*}} @_ZN1SIdE1fEv() - // CHECK-NOT: nounwind + // CHECK-NOT: #1 void (*f4)() = &S<double>::f; - // CHECK: define {{.*}} @_Z1fIA4_cEvv() nounwind "target-features"={{.*}} { + // CHECK: define {{.*}} @_Z1fIA4_cEvv() #1 { (void)&f<char[4]>; - // CHECK: define {{.*}} @_Z1fIcEvv() "target-features"={{.*}} { + // CHECK: define {{.*}} @_Z1fIcEvv() #0 { (void)&f<char>; - // CHECK: define {{.*}} @_ZN1SIA4_cE1fEv() nounwind + // CHECK: define {{.*}} @_ZN1SIA4_cE1fEv() #1 (void)&S<char[4]>::f; // CHECK: define {{.*}} @_ZN1SIcE1fEv() - // CHECK-NOT: nounwind + // CHECK-NOT: #1 (void)&S<char>::f; } // CHECK: define {{.*}} @_Z1iv void i() { - // CHECK: declare {{.*}} @_Z1gIiEvv() nounwind + // CHECK: declare {{.*}} @_Z1gIiEvv() #1 g<int>(); // CHECK: declare {{.*}} @_Z1gIA2_iEvv() - // CHECK-NOT: nounwind + // CHECK-NOT: #1 g<int[2]>(); - // CHECK: declare {{.*}} @_ZN1SIiE1gEv() nounwind + // CHECK: declare {{.*}} @_ZN1SIiE1gEv() #1 S<int>::g(); // CHECK: declare {{.*}} @_ZN1SIA2_iE1gEv() - // CHECK-NOT: nounwind + // CHECK-NOT: #1 S<int[2]>::g(); - // CHECK: declare {{.*}} @_Z1gIfEvv() nounwind + // CHECK: declare {{.*}} @_Z1gIfEvv() #1 void (*g1)() = &g<float>; // CHECK: declare {{.*}} @_Z1gIdEvv() - // CHECK-NOT: nounwind + // CHECK-NOT: #1 void (*g2)() = &g<double>; - // CHECK: declare {{.*}} @_ZN1SIfE1gEv() nounwind + // CHECK: declare {{.*}} @_ZN1SIfE1gEv() #1 void (*g3)() = &S<float>::g; // CHECK: declare {{.*}} @_ZN1SIdE1gEv() - // CHECK-NOT: nounwind + // CHECK-NOT: #1 void (*g4)() = &S<double>::g; - // CHECK: declare {{.*}} @_Z1gIA4_cEvv() nounwind + // CHECK: declare {{.*}} @_Z1gIA4_cEvv() #1 (void)&g<char[4]>; // CHECK: declare {{.*}} @_Z1gIcEvv() - // CHECK-NOT: nounwind + // CHECK-NOT: #1 (void)&g<char>; - // CHECK: declare {{.*}} @_ZN1SIA4_cE1gEv() nounwind + // CHECK: declare {{.*}} @_ZN1SIA4_cE1gEv() #1 (void)&S<char[4]>::g; // CHECK: declare {{.*}} @_ZN1SIcE1gEv() - // CHECK-NOT: nounwind + // CHECK-NOT: #1 (void)&S<char>::g; } @@ -113,8 +113,12 @@ template<typename T> struct Nested { // CHECK: define {{.*}} @_Z1jv void j() { // CHECK: declare {{.*}} @_ZN6NestedIiE1fILb1EcEEvv( - // CHECK-NOT: nounwind + // CHECK-NOT: #1 Nested<int>().f<true, char>(); - // CHECK: declare {{.*}} @_ZN6NestedIlE1fILb0ElEEvv({{.*}}) nounwind + // CHECK: declare {{.*}} @_ZN6NestedIlE1fILb0ElEEvv({{.*}}) #1 Nested<long>().f<false, long>(); } + +// CHECK: attributes #0 = { "target-features"={{.*}} } +// CHECK: attributes #1 = { nounwind "target-features"={{.*}} } +// CHECK: attributes #2 = { noinline noreturn nounwind } diff --git a/clang/test/CodeGenCXX/cxx11-noreturn.cpp b/clang/test/CodeGenCXX/cxx11-noreturn.cpp index ee513120f9a..fe67a298a45 100644 --- a/clang/test/CodeGenCXX/cxx11-noreturn.cpp +++ b/clang/test/CodeGenCXX/cxx11-noreturn.cpp @@ -2,7 +2,11 @@ int g(); -// CHECK: _Z1fv(){{.*}} noreturn +// CHECK: _Z1fv(){{.*}} #0 [[noreturn]] int f() { while (g()) {} } + +// CHECK: attributes #0 = { noreturn nounwind "target-features"={{.*}} } +// CHECK: attributes #1 = { "target-features"={{.*}} } +// CHECK: attributes #2 = { noreturn nounwind } diff --git a/clang/test/CodeGenCXX/default-destructor-synthesis.cpp b/clang/test/CodeGenCXX/default-destructor-synthesis.cpp index fac5cc01f6b..d5f57215df6 100644 --- a/clang/test/CodeGenCXX/default-destructor-synthesis.cpp +++ b/clang/test/CodeGenCXX/default-destructor-synthesis.cpp @@ -24,7 +24,7 @@ struct M : Q, P { Q q_arr[2][3]; }; -// CHECK: define i32 @_Z1fv() nounwind +// CHECK: define i32 @_Z1fv() #0 int f() { { count = 1; @@ -34,3 +34,5 @@ int f() { // CHECK: ret i32 1 return count; } + +// CHECK: attributes #0 = { nounwind "target-features"={{.*}} } diff --git a/clang/test/CodeGenCXX/derived-to-base.cpp b/clang/test/CodeGenCXX/derived-to-base.cpp index 76b79fc3a8d..1c9cdbc9827 100644 --- a/clang/test/CodeGenCXX/derived-to-base.cpp +++ b/clang/test/CodeGenCXX/derived-to-base.cpp @@ -15,7 +15,7 @@ void f() { b.f(); } -// CHECK: define %struct.B* @_Z1fP1A(%struct.A* %a) nounwind +// CHECK: define %struct.B* @_Z1fP1A(%struct.A* %a) #0 B *f(A *a) { // CHECK-NOT: br label // CHECK: ret %struct.B* @@ -25,7 +25,7 @@ B *f(A *a) { // PR5965 namespace PR5965 { -// CHECK: define %struct.A* @_ZN6PR59651fEP1B(%struct.B* %b) nounwind +// CHECK: define %struct.A* @_ZN6PR59651fEP1B(%struct.B* %b) #0 A *f(B* b) { // CHECK-NOT: br label // CHECK: ret %struct.A* @@ -45,3 +45,6 @@ namespace test3 { foo(B()); } } + +// CHECK: attributes #0 = { nounwind "target-features"={{.*}} } +// CHECK: attributes #1 = { "target-features"={{.*}} } diff --git a/clang/test/CodeGenCXX/dynamic-cast.cpp b/clang/test/CodeGenCXX/dynamic-cast.cpp index 77cfce1d460..6b145d8343e 100644 --- a/clang/test/CodeGenCXX/dynamic-cast.cpp +++ b/clang/test/CodeGenCXX/dynamic-cast.cpp @@ -17,4 +17,8 @@ const B& f(A *a) { return fail; } -// CHECK: declare i8* @__dynamic_cast(i8*, i8*, i8*, i64) nounwind readonly +// CHECK: declare i8* @__dynamic_cast(i8*, i8*, i8*, i64) #2 + +// CHECK: attributes #0 = { inlinehint nounwind "target-features"={{.*}} } +// CHECK: attributes #1 = { "target-features"={{.*}} } +// CHECK: attributes #2 = { nounwind readonly } diff --git a/clang/test/CodeGenCXX/exceptions.cpp b/clang/test/CodeGenCXX/exceptions.cpp index f9727282c55..14133fa0688 100644 --- a/clang/test/CodeGenCXX/exceptions.cpp +++ b/clang/test/CodeGenCXX/exceptions.cpp @@ -71,7 +71,7 @@ namespace test1 { // rdar://11904428 // Terminate landing pads should call __cxa_begin_catch first. - // CHECK: define linkonce_odr hidden void @__clang_call_terminate(i8*) noinline noreturn nounwind + // CHECK: define linkonce_odr hidden void @__clang_call_terminate(i8*) #2 // CHECK-NEXT: [[T0:%.*]] = call i8* @__cxa_begin_catch(i8* %0) nounwind // CHECK-NEXT: call void @_ZSt9terminatev() noreturn nounwind // CHECK-NEXT: unreachable @@ -525,3 +525,8 @@ namespace test11 { // CHECK: resume // (After this is a terminate landingpad.) } + +// CHECK: attributes #0 = { "target-features"={{.*}} } +// CHECK: attributes #1 = { nounwind "target-features"={{.*}} } +// CHECK: attributes #2 = { noinline noreturn nounwind } +// CHECK: attributes #3 = { nounwind readnone } diff --git a/clang/test/CodeGenCXX/global-dtor-no-atexit.cpp b/clang/test/CodeGenCXX/global-dtor-no-atexit.cpp index def97b23615..40be07a4415 100644 --- a/clang/test/CodeGenCXX/global-dtor-no-atexit.cpp +++ b/clang/test/CodeGenCXX/global-dtor-no-atexit.cpp @@ -5,12 +5,12 @@ // CHECK: call void @_ZN1AC1Ev([[A:%.*]]* @a) // CHECK-NEXT: call i32 @atexit(void ()* @__dtor_a) -// CHECK: define internal void @__dtor_a() nounwind +// CHECK: define internal void @__dtor_a() #0 // CHECK: call void @_ZN1AD1Ev([[A]]* @a) // CHECK: call void @_ZN1AC1Ev([[A]]* @b) // CHECK-NEXT: call i32 @atexit(void ()* @__dtor_b) -// CHECK: define internal void @__dtor_b() nounwind +// CHECK: define internal void @__dtor_b() #0 // CHECK: call void @_ZN1AD1Ev([[A]]* @b) class A { @@ -33,12 +33,16 @@ A a, b; // CHECK-NEXT: call i32 @atexit(void ()* @__dtor__ZZ4funcvE2a2) // CHECK-NEXT: call void @__cxa_guard_release(i64* @_ZGVZ4funcvE2a2) -// CHECK: define internal void @__dtor__ZZ4funcvE2a1() nounwind +// CHECK: define internal void @__dtor__ZZ4funcvE2a1() #0 // CHECK: call void @_ZN1AD1Ev([[A]]* @_ZZ4funcvE2a1) -// CHECK: define internal void @__dtor__ZZ4funcvE2a2() nounwind +// CHECK: define internal void @__dtor__ZZ4funcvE2a2() #0 // CHECK: call void @_ZN1AD1Ev([[A]]* @_ZZ4funcvE2a2) void func() { static A a1, a2; } + +// CHECK: attributes #0 = { nounwind } +// CHECK: attributes #1 = { "target-features"={{.*}} } +// CHECK: attributes #2 = { nounwind "target-features"={{.*}} } diff --git a/clang/test/CodeGenCXX/global-init.cpp b/clang/test/CodeGenCXX/global-init.cpp index 2a53ad9e3e7..ddad2d2ebca 100644 --- a/clang/test/CodeGenCXX/global-init.cpp +++ b/clang/test/CodeGenCXX/global-init.cpp @@ -200,4 +200,15 @@ namespace test7 { // CHECK: call void [[TEST1_Z_INIT]] // rdar://problem/8090834: this should be nounwind -// CHECK-NOEXC: define internal void @_GLOBAL__I_a() nounwind section "__TEXT,__StaticInit,regular,pure_instructions" { +// CHECK-NOEXC: define internal void @_GLOBAL__I_a() #0 section "__TEXT,__StaticInit,regular,pure_instructions" { + +// CHECK: attributes #0 = { "target-features"={{.*}} } +// CHECK: attributes #1 = { nounwind } +// CHECK: attributes #2 = { nounwind "target-features"={{.*}} } +// CHECK: attributes #3 = { noinline noreturn nounwind } +// CHECK: attributes #4 = { nounwind readonly } + +// CHECK-NOEXC: attributes #0 = { nounwind } +// CHECK-NOEXC: attributes #1 = { "target-features"={{.*}} } +// CHECK-NOEXC: attributes #2 = { nounwind "target-features"={{.*}} } +// CHECK-NOEXC: attributes #3 = { nounwind readonly } diff --git a/clang/test/CodeGenCXX/member-initializers.cpp b/clang/test/CodeGenCXX/member-initializers.cpp index 244a164b9fe..9a5a79fca3e 100644 --- a/clang/test/CodeGenCXX/member-initializers.cpp +++ b/clang/test/CodeGenCXX/member-initializers.cpp @@ -12,7 +12,7 @@ struct B : A { int i; }; -// CHECK: define i32 @_Z1fv() nounwind +// CHECK: define i32 @_Z1fv() #0 int f() { B b; @@ -21,7 +21,7 @@ int f() { } // Test that we don't try to fold the default value of j when initializing i. -// CHECK: define i32 @_Z9test_foldv() nounwind +// CHECK: define i32 @_Z9test_foldv() #0 int test_fold() { struct A { A(const int j = 1) : i(j) { } @@ -32,3 +32,4 @@ int test_fold() { return A(2).i; } +// CHECK: attributes #0 = { nounwind readnone "target-features"={{.*}} } diff --git a/clang/test/CodeGenCXX/microsoft-abi-array-cookies.cpp b/clang/test/CodeGenCXX/microsoft-abi-array-cookies.cpp index e07b0974473..31533ddccd4 100644 --- a/clang/test/CodeGenCXX/microsoft-abi-array-cookies.cpp +++ b/clang/test/CodeGenCXX/microsoft-abi-array-cookies.cpp @@ -5,7 +5,7 @@ struct ClassWithoutDtor { }; void check_array_no_cookies() { -// CHECK: define void @"\01?check_array_no_cookies@@YAXXZ"() nounwind +// CHECK: define void @"\01?check_array_no_cookies@@YAXXZ"() #0 // CHECK: call noalias i8* @"\01??_U@YAPAXI@Z"(i32 42) ClassWithoutDtor *array = new ClassWithoutDtor[42]; @@ -57,3 +57,6 @@ void check_array_cookies_aligned() { // CHECK: [[ARRAY_AS_CHAR:%.*]] = bitcast [[CLASS]]* // CHECK: getelementptr inbounds i8* [[ARRAY_AS_CHAR]], i64 -8 } + +// CHECK: attributes #0 = { nounwind "target-features"={{.*}} } +// CHECK: attributes #1 = { "target-features"={{.*}} } diff --git a/clang/test/CodeGenCXX/microsoft-abi-static-initializers.cpp b/clang/test/CodeGenCXX/microsoft-abi-static-initializers.cpp index 448f1eeeb91..112228a9d94 100644 --- a/clang/test/CodeGenCXX/microsoft-abi-static-initializers.cpp +++ b/clang/test/CodeGenCXX/microsoft-abi-static-initializers.cpp @@ -5,12 +5,12 @@ struct S { ~S() {} } s; -// CHECK: define internal void [[INIT_s:@.*global_var.*]] nounwind +// CHECK: define internal void [[INIT_s:@.*global_var.*]] #0 // CHECK: %{{[.0-9A-Z_a-z]+}} = call x86_thiscallcc %struct.S* @"\01??0S@@QAE@XZ" // CHECK: call i32 @atexit(void ()* @"__dtor_\01?s@@3US@@A") // CHECK: ret void -// CHECK: define internal void @"__dtor_\01?s@@3US@@A"() nounwind { +// CHECK: define internal void @"__dtor_\01?s@@3US@@A"() #0 { // CHECK: call x86_thiscallcc void @"\01??1S@@QAE@XZ" // CHECK: ret void @@ -33,7 +33,7 @@ void force_usage() { (void)B<int>::foo; // (void) - force usage } -// CHECK: define internal void [[INIT_foo:@.*global_var.*]] nounwind +// CHECK: define internal void [[INIT_foo:@.*global_var.*]] #0 // CHECK: %{{[.0-9A-Z_a-z]+}} = call x86_thiscallcc %class.A* @"\01??0A@@QAE@XZ" // CHECK: call i32 @atexit(void ()* [[FOO_DTOR:@"__dtor_.*foo@.*]]) // CHECK: ret void @@ -46,7 +46,10 @@ void force_usage() { // CHECK: call x86_thiscallcc void @"\01??1A@@QAE@XZ"{{.*}}foo // CHECK: ret void -// CHECK: define internal void @_GLOBAL__I_a() nounwind { +// CHECK: define internal void @_GLOBAL__I_a() #0 { // CHECK: call void [[INIT_s]] // CHECK: call void [[INIT_foo]] // CHECK: ret void + +// CHECK: attributes #0 = { nounwind } +// CHECK: attributes #1 = { nounwind "target-features"={{.*}} } diff --git a/clang/test/CodeGenCXX/no-exceptions.cpp b/clang/test/CodeGenCXX/no-exceptions.cpp index da672c43f8d..4264953b007 100644 --- a/clang/test/CodeGenCXX/no-exceptions.cpp +++ b/clang/test/CodeGenCXX/no-exceptions.cpp @@ -2,7 +2,7 @@ void g(); -// CHECK: define void @_Z1fv() nounwind +// CHECK: define void @_Z1fv() #0 void f() throw (int) { // CHECK-NOT: invoke void @_Z1gv @@ -10,3 +10,6 @@ void f() throw (int) { // CHECK: call void @_Z1gv() // CHECK: ret void } + +// CHECK: attributes #0 = { nounwind "target-features"={{.*}} } +// CHECK: attributes #1 = { "target-features"={{.*}} } diff --git a/clang/test/CodeGenCXX/noinline-template.cpp b/clang/test/CodeGenCXX/noinline-template.cpp index 9559fde9066..af88a849b15 100644 --- a/clang/test/CodeGenCXX/noinline-template.cpp +++ b/clang/test/CodeGenCXX/noinline-template.cpp @@ -3,7 +3,7 @@ // This was a problem in Sema, but only shows up as noinline missing // in CodeGen. -// CHECK: define linkonce_odr void @_ZN6VectorIiE13growStorageByEv(%struct.Vector* %this) noinline nounwind +// CHECK: define linkonce_odr void @_ZN6VectorIiE13growStorageByEv(%struct.Vector* %this) #1 template <class Ty> struct Vector { void growStorageBy(); @@ -14,3 +14,6 @@ void foo() { Vector<int> strs; strs.growStorageBy(); } + +// CHECK: attributes #0 = { nounwind "target-features"={{.*}} } +// CHECK: attributes #1 = { noinline nounwind "target-features"={{.*}} } diff --git a/clang/test/CodeGenCXX/pointers-to-data-members.cpp b/clang/test/CodeGenCXX/pointers-to-data-members.cpp index fe69cd5ddf7..a69093f8ce1 100644 --- a/clang/test/CodeGenCXX/pointers-to-data-members.cpp +++ b/clang/test/CodeGenCXX/pointers-to-data-members.cpp @@ -151,13 +151,13 @@ struct A { A() : a() {} }; -// CHECK-O3: define zeroext i1 @_ZN6PR71395checkEv() nounwind readnone +// CHECK-O3: define zeroext i1 @_ZN6PR71395checkEv() #0 bool check() { // CHECK-O3: ret i1 true return A().a.data == 0; } -// CHECK-O3: define zeroext i1 @_ZN6PR71396check2Ev() nounwind readnone +// CHECK-O3: define zeroext i1 @_ZN6PR71396check2Ev() #0 bool check2() { // CHECK-O3: ret i1 true return ptr_to_member_type() == 0; @@ -254,3 +254,8 @@ namespace PR13097 { // CHECK-NOT: memcpy // CHECK: call void @_ZN7PR130971XC1ERKS0_ } + +// CHECK-O3: attributes #0 = { nounwind readnone "target-features"={{.*}} } +// CHECK-O3: attributes #1 = { nounwind "target-features"={{.*}} } +// CHECK-O3: attributes #2 = { "target-features"={{.*}} } +// CHECK-O3: attributes #3 = { nounwind } diff --git a/clang/test/CodeGenCXX/reference-cast.cpp b/clang/test/CodeGenCXX/reference-cast.cpp index 1d08b2b2e4b..ec4fdaf1965 100644 --- a/clang/test/CodeGenCXX/reference-cast.cpp +++ b/clang/test/CodeGenCXX/reference-cast.cpp @@ -3,7 +3,7 @@ // PR6024 extern int i; -// CHECK: define i32* @_Z16lvalue_noop_castv() nounwind +// CHECK: define i32* @_Z16lvalue_noop_castv() #0 const int &lvalue_noop_cast() { if (i == 0) // CHECK: store i32 17, i32* @@ -192,3 +192,6 @@ namespace PR10650 { // CHECK: define i64 @_ZN7PR106504testEPNS_6HelperE // CHECK: store i64 } + +// CHECK: attributes #0 = { nounwind "target-features"={{.*}} } +// CHECK: attributes #1 = { "target-features"={{.*}} } diff --git a/clang/test/CodeGenCXX/threadsafe-statics.cpp b/clang/test/CodeGenCXX/threadsafe-statics.cpp index 8afc2746f42..a28d0fccbd2 100644 --- a/clang/test/CodeGenCXX/threadsafe-statics.cpp +++ b/clang/test/CodeGenCXX/threadsafe-statics.cpp @@ -6,7 +6,7 @@ int f(); // WITH-TSS: @_ZZ1gvE1a = internal global i32 0, align 4 // WITH-TSS: @_ZGVZ1gvE1a = internal global i64 0 -// WITH-TSS: define void @_Z1gv() nounwind +// WITH-TSS: define void @_Z1gv() #0 // WITH-TSS: call i32 @__cxa_guard_acquire // WITH-TSS: call void @__cxa_guard_release // WITH-TSS: ret void @@ -17,7 +17,14 @@ void g() { // NO-TSS: @_ZZ1gvE1a = internal global i32 0, align 4 // NO-TSS: @_ZGVZ1gvE1a = internal global i8 0 -// NO-TSS: define void @_Z1gv() nounwind +// NO-TSS: define void @_Z1gv() #0 // NO-TSS-NOT: call i32 @__cxa_guard_acquire // NO-TSS-NOT: call void @__cxa_guard_release // NO-TSS: ret void + +// WITH-TSS: attributes #0 = { nounwind "target-features"={{.*}} } +// WITH-TSS: attributes #1 = { nounwind } +// WITH-TSS: attributes #2 = { "target-features"={{.*}} } + +// NO-TSS: attributes #0 = { nounwind "target-features"={{.*}} } +// NO-TSS: attributes #1 = { "target-features"={{.*}} } diff --git a/clang/test/CodeGenCXX/thunks.cpp b/clang/test/CodeGenCXX/thunks.cpp index 0659259c179..70607087437 100644 --- a/clang/test/CodeGenCXX/thunks.cpp +++ b/clang/test/CodeGenCXX/thunks.cpp @@ -339,7 +339,7 @@ namespace Test14 { }; void C::f() { } - // CHECK: define void @_ZThn8_N6Test141C1fEv({{.*}}) {{.*}} uwtable + // CHECK: define void @_ZThn8_N6Test141C1fEv({{.*}}) unnamed_addr #0 } /**** The following has to go at the end of the file ****/ @@ -347,3 +347,8 @@ namespace Test14 { // This is from Test5: // CHECK: define linkonce_odr void @_ZTv0_n24_N5Test51B1fEv // CHECK: define internal void @_ZThn8_N6Test4B12_GLOBAL__N_11C1fEv( + +// CHECK: attributes #0 = { nounwind uwtable "target-features"={{.*}} } +// CHECK: attributes #1 = { inlinehint nounwind uwtable "target-features"={{.*}} } +// CHECK: attributes #2 = { "target-features"={{.*}} } +// CHECK: attributes #3 = { nounwind "target-features"={{.*}} } diff --git a/clang/test/CodeGenCXX/typeid.cpp b/clang/test/CodeGenCXX/typeid.cpp index fce3795344b..745a011843f 100644 --- a/clang/test/CodeGenCXX/typeid.cpp +++ b/clang/test/CodeGenCXX/typeid.cpp @@ -42,3 +42,6 @@ const char *f() { } } + +// CHECK: attributes #0 = { "target-features"={{.*}} } +// CHECK: attributes #1 = { nounwind "target-features"={{.*}} } diff --git a/clang/test/CodeGenCXX/virtual-base-cast.cpp b/clang/test/CodeGenCXX/virtual-base-cast.cpp index 73b7c1c9529..5cf3b8729a2 100644 --- a/clang/test/CodeGenCXX/virtual-base-cast.cpp +++ b/clang/test/CodeGenCXX/virtual-base-cast.cpp @@ -11,23 +11,25 @@ struct D : virtual C, virtual CC { int e; }; D* x; A* a() { return x; } -// CHECK: @_Z1av() nounwind +// CHECK: @_Z1av() #0 // CHECK: [[VBASEOFFSETPTRA:%[a-zA-Z0-9\.]+]] = getelementptr i8* {{.*}}, i64 -16 // CHECK: [[CASTVBASEOFFSETPTRA:%[a-zA-Z0-9\.]+]] = bitcast i8* [[VBASEOFFSETPTRA]] to i32* // CHECK: load i32* [[CASTVBASEOFFSETPTRA]] // CHECK: } B* b() { return x; } -// CHECK: @_Z1bv() nounwind +// CHECK: @_Z1bv() #0 // CHECK: [[VBASEOFFSETPTRA:%[a-zA-Z0-9\.]+]] = getelementptr i8* {{.*}}, i64 -20 // CHECK: [[CASTVBASEOFFSETPTRA:%[a-zA-Z0-9\.]+]] = bitcast i8* [[VBASEOFFSETPTRA]] to i32* // CHECK: load i32* [[CASTVBASEOFFSETPTRA]] // CHECK: } BB* c() { return x; } -// CHECK: @_Z1cv() nounwind +// CHECK: @_Z1cv() #0 // CHECK: [[VBASEOFFSETPTRC:%[a-zA-Z0-9\.]+]] = getelementptr i8* {{.*}}, i64 -24 // CHECK: [[CASTVBASEOFFSETPTRC:%[a-zA-Z0-9\.]+]] = bitcast i8* [[VBASEOFFSETPTRC]] to i32* // CHECK: [[VBASEOFFSETC:%[a-zA-Z0-9\.]+]] = load i32* [[CASTVBASEOFFSETPTRC]] // CHECK: add i32 [[VBASEOFFSETC]], 8 // CHECK: } + +// CHECK: attributes #0 = { nounwind "target-features"={{.*}} } |