Modify the tests to use attribute group references instead of listing the

function attributes.

llvm-svn: 175606
This commit is contained in:
Bill Wendling 2013-02-20 07:22:19 +00:00
parent 90bc19cd91
commit c33fc4c004
54 changed files with 584 additions and 359 deletions

View File

@ -164,14 +164,19 @@ void tsw() {
Sw<int> swi;
Sw<B> swb;
}
// CHECK-NOT: define linkonce_odr {{.*}} @_ZN2SwI1BED1Ev({{.*}} nounwind
// CHECK-NOT: define linkonce_odr {{.*}} @_ZN2SwI1BED1Ev({{.*}} #2
// CHECK: define linkonce_odr {{.*}} @_ZN2SwI1BED1Ev({{.*}}
// CHECK: _ZTIi
// CHECK: __cxa_call_unexpected
// CHECK: define linkonce_odr {{.*}} @_ZN2SwIiED1Ev({{.*}} nounwind
// CHECK: define linkonce_odr {{.*}} @_ZN2SwIiED1Ev({{.*}} #2
template <typename T>
struct TVC : VX
{ virtual ~TVC(); };
template <typename T>
TVC<T>::~TVC() {}
// CHECK: attributes #0 = { "target-features"="-sse4a,-avx2,-xop,-fma4,-bmi2,-3dnow,-3dnowa,-pclmul,+sse,-avx,-sse41,-ssse3,+mmx,-rtm,-sse42,-lzcnt,-f16c,-popcnt,-bmi,-aes,-fma,-rdrand,+sse2,-sse3" }
// CHECK: attributes #1 = { noinline noreturn nounwind }
// CHECK: attributes #2 = { nounwind "target-features"="-sse4a,-avx2,-xop,-fma4,-bmi2,-3dnow,-3dnowa,-pclmul,+sse,-avx,-sse41,-ssse3,+mmx,-rtm,-sse42,-lzcnt,-f16c,-popcnt,-bmi,-aes,-fma,-rdrand,+sse2,-sse3" }
// CHECK: attributes #3 = { inlinehint nounwind "target-features"="-sse4a,-avx2,-xop,-fma4,-bmi2,-3dnow,-3dnowa,-pclmul,+sse,-avx,-sse41,-ssse3,+mmx,-rtm,-sse42,-lzcnt,-f16c,-popcnt,-bmi,-aes,-fma,-rdrand,+sse2,-sse3" }

View File

@ -2,9 +2,12 @@
void f(void);
void g(void) {
// CHECK: define void @g() nounwind
// CHECK: define void @g() #0
// CHECK-NOT: call void @f() nounwind
f();
}
// CHECK-NOT: declare void @f() nounwind
// CHECK-NOT: declare void @f() #0
// CHECK: attributes #0 = { nounwind {{.*}} }
// CHECK: attributes #1 = { "target-features"={{.*}} }

View File

@ -10,37 +10,44 @@
// when AddressSanitizer is enabled, unless no_address_safety_analysis attribute
// is present.
// CHECK-NOT: NoAddressSafety1{{.*}} address_safety
// ASAN-NOT: NoAddressSafety1{{.*}} address_safety
// CHECK: NoAddressSafety1{{.*}}#0
// ASAN: NoAddressSafety1{{.*}}#0
__attribute__((no_address_safety_analysis))
int NoAddressSafety1(int *a) { return *a; }
// CHECK-NOT: NoAddressSafety2{{.*}} address_safety
// ASAN-NOT: NoAddressSafety2{{.*}} address_safety
// CHECK: NoAddressSafety2{{.*}}#0
// ASAN: NoAddressSafety2{{.*}}#0
__attribute__((no_address_safety_analysis))
int NoAddressSafety2(int *a);
int NoAddressSafety2(int *a) { return *a; }
// CHECK-NOT: AddressSafetyOk{{.*}} address_safety
// ASAN: AddressSafetyOk{{.*}} address_safety
// CHECK: AddressSafetyOk{{.*}}#0
// ASAN: AddressSafetyOk{{.*}}#1
int AddressSafetyOk(int *a) { return *a; }
// CHECK-NOT: TemplateNoAddressSafety{{.*}} address_safety
// ASAN-NOT: TemplateNoAddressSafety{{.*}} address_safety
// CHECK: TemplateAddressSafetyOk{{.*}}#0
// ASAN: TemplateAddressSafetyOk{{.*}}#1
template<int i>
int TemplateAddressSafetyOk() { return i; }
// CHECK: TemplateNoAddressSafety{{.*}}#0
// ASAN: TemplateNoAddressSafety{{.*}}#0
template<int i>
__attribute__((no_address_safety_analysis))
int TemplateNoAddressSafety() { return i; }
// CHECK-NOT: TemplateAddressSafetyOk{{.*}} address_safety
// ASAN: TemplateAddressSafetyOk{{.*}} address_safety
template<int i>
int TemplateAddressSafetyOk() { return i; }
int force_instance = TemplateAddressSafetyOk<42>()
+ TemplateNoAddressSafety<42>();
// Check that __cxx_global_var_init* get the address_safety attribute.
int global1 = 0;
int global2 = *(int*)((char*)&global1+1);
// CHECK-NOT: @__cxx_global_var_init{{.*}}address_safety
// ASAN: @__cxx_global_var_init{{.*}}address_safety
// CHECK: @__cxx_global_var_init{{.*}}#1
// ASAN: @__cxx_global_var_init{{.*}}#2
// CHECK: attributes #0 = { nounwind "target-features"={{.*}} }
// CHECK: attributes #1 = { nounwind }
// ASAN: attributes #0 = { nounwind "target-features"={{.*}} }
// ASAN: attributes #1 = { address_safety nounwind "target-features"={{.*}} }
// ASAN: attributes #2 = { address_safety nounwind }

View File

@ -1,6 +1,6 @@
// RUN: %clang_cc1 -emit-llvm -triple x86_64-apple-darwin10 < %s -o - | FileCheck %s
// CHECK:%struct.S = type { i32, i32 }
// CHECK:define void @test_addrspace(%struct.S addrspace(1)* %p1, %struct.S addrspace(2)* %p2) nounwind
// CHECK:define void @test_addrspace(%struct.S addrspace(1)* %p1, %struct.S addrspace(2)* %p2) #0
// CHECK: [[p1addr:%.*]] = alloca %struct.S addrspace(1)*
// CHECK: [[p2addr:%.*]] = alloca %struct.S addrspace(2)*
// CHECK: store %struct.S addrspace(1)* %p1, %struct.S addrspace(1)** [[p1addr]]
@ -36,3 +36,5 @@ void test_addrspace(__addr1 S* p1, __addr2 S*p2) {
p1->a = p2->b;
p1->b = p2->a;
}
// CHECK: attributes #0 = { nounwind "target-features"={{.*}} }

View File

@ -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() #0 {
// Make sure that aliases cause referenced values to be emitted.
// PR3200
@ -34,13 +34,19 @@ static int inner_weak(int a) { return 0; }
extern __typeof(inner) inner_a __attribute__((alias("inner")));
static __typeof(inner_weak) inner_weak_a __attribute__((weakref, alias("inner_weak")));
// CHECKCC: @inner_a = alias i32 (i32)* @inner
// CHECKCC: define internal arm_aapcs_vfpcc i32 @inner(i32 %a) nounwind {
// CHECKCC: define internal arm_aapcs_vfpcc i32 @inner(i32 %a) #0 {
int outer(int a) { return inner(a); }
// CHECKCC: define arm_aapcs_vfpcc i32 @outer(i32 %a) nounwind {
// CHECKCC: define arm_aapcs_vfpcc i32 @outer(i32 %a) #0 {
// CHECKCC: call arm_aapcs_vfpcc i32 @inner(i32 %{{.*}})
int outer_weak(int a) { return inner_weak_a(a); }
// CHECKCC: define arm_aapcs_vfpcc i32 @outer_weak(i32 %a) nounwind {
// CHECKCC: define arm_aapcs_vfpcc i32 @outer_weak(i32 %a) #0 {
// 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) #0 {
// CHECKBASIC: attributes #0 = { nounwind "target-features"={{.*}} }
// CHECKBASIC: attributes #1 = { inlinehint nounwind "target-features"={{.*}} }
// CHECKCC: attributes #0 = { nounwind }
// CHECKCC: attributes #1 = { inlinehint nounwind }

View File

@ -4,6 +4,8 @@ int test1() __attribute__((__cold__)) {
return 42;
// Check that we set the optsize attribute on the function.
// CHECK: @test1{{.*}}optsize
// CHECK: @test1{{.*}}#0
// CHECK: ret
}
// CHECK: attributes #0 = { nounwind optsize "target-features"={{.*}} }

View File

@ -9,27 +9,27 @@
int test1() {
return 42;
// Oz: @{{.*}}test1{{.*}}minsize
// Oz: @{{.*}}test1{{.*}}#0
// Oz: ret
// OTHER: @{{.*}}test1
// OTHER-NOT: minsize
// OTHER-NOT: #1
// OTHER: ret
}
int test2() {
return 42;
// Oz: @{{.*}}test2{{.*}}minsize
// Oz: @{{.*}}test2{{.*}}#0
// Oz: ret
// OTHER: @{{.*}}test2
// OTHER-NOT: minsize
// OTHER-NOT: #1
// OTHER: ret
}
__attribute__((minsize))
int test3() {
return 42;
// Oz: @{{.*}}test3{{.*}}minsize
// OTHER: @{{.*}}test3{{.*}}minsize
// Oz: @{{.*}}test3{{.*}}#0
// OTHER: @{{.*}}test3{{.*}}#1
}
// Check that the minsize attribute is well propagated through
@ -44,16 +44,16 @@ void test4(T arg) {
template
void test4<int>(int arg);
// Oz: define{{.*}}void @{{.*}}test4
// Oz: minsize
// Oz: #0
// OTHER: define{{.*}}void @{{.*}}test4
// OTHER: minsize
// OTHER: #1
template
void test4<float>(float arg);
// Oz: define{{.*}}void @{{.*}}test4
// Oz: minsize
// Oz: #0
// OTHER: define{{.*}}void @{{.*}}test4
// OTHER: minsize
// OTHER: #1
template<typename T>
void test5(T arg) {
@ -63,13 +63,18 @@ void test5(T arg) {
template
void test5<int>(int arg);
// Oz: define{{.*}}void @{{.*}}test5
// Oz: minsize
// Oz: #0
// OTHER: define{{.*}}void @{{.*}}test5
// OTHER-NOT: define{{.*}}void @{{.*}}test5{{.*}}minsize
// OTHER-NOT: define{{.*}}void @{{.*}}test5{{.*}}#1
template
void test5<float>(float arg);
// Oz: define{{.*}}void @{{.*}}test5
// Oz: minsize
// Oz: #0
// OTHER: define{{.*}}void @{{.*}}test5
// OTHER-NOT: define{{.*}}void @{{.*}}test5{{.*}}minsize
// OTHER-NOT: define{{.*}}void @{{.*}}test5{{.*}}#1
// Oz: attributes #0 = { minsize nounwind optsize readnone "target-features"={{.*}} }
// OTHER: attributes #0 = { nounwind {{.*}}"target-features"={{.*}} }
// OTHER: attributes #1 = { minsize nounwind {{.*}}"target-features"={{.*}} }

View File

@ -4,13 +4,15 @@ 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() #0 {
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() #0 {
__attribute((naked, always_inline)) void t2() {
}
// CHECK: attributes #0 = { naked noinline nounwind "target-features"={{.*}} }

View File

@ -36,39 +36,39 @@ int t17() {
return t15() + t16;
}
// CHECK: define void @t1() noreturn nounwind {{.*}} {
// CHECK: define void @t1() #2 {
void t1() __attribute__((noreturn));
void t1() { while (1) {} }
// CHECK: define void @t2() nounwind {{.*}} {
// CHECK: define void @t2() #0 {
void t2() __attribute__((nothrow));
void t2() {}
// CHECK: define weak void @t3() nounwind {{.*}} {
// CHECK: define weak void @t3() #0 {
void t3() __attribute__((weak));
void t3() {}
// CHECK: define hidden void @t4() nounwind {{.*}} {
// CHECK: define hidden void @t4() #0 {
void t4() __attribute__((visibility("hidden")));
void t4() {}
// CHECK: define void @t7() noreturn nounwind {{.*}} {
// CHECK: define void @t7() #2 {
void t7() __attribute__((noreturn, nothrow));
void t7() { while (1) {} }
// CHECK: define void @t10() nounwind {{.*}} section "SECT" {
// CHECK: define void @t10() #0 section "SECT" {
void t10(void) __attribute__((section("SECT")));
void t10(void) {}
// CHECK: define void @t11() nounwind {{.*}} section "SECT" {
// CHECK: define void @t11() #0 section "SECT" {
void __attribute__((section("SECT"))) t11(void) {}
// CHECK: define i32 @t19() nounwind {{.*}} {
// CHECK: define i32 @t19() #0 {
extern int t19(void) __attribute__((weak_import));
int t19(void) {
return 10;
}
// CHECK:define void @t20() nounwind {{.*}} {
// CHECK:define void @t20() #0 {
// CHECK: call void @abort()
// CHECK-NEXT: unreachable
void t20(void) {
@ -88,4 +88,8 @@ 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() #0 section ".bar"
// CHECK: attributes #0 = { nounwind "target-features"={{.*}} }
// CHECK: attributes #1 = { "target-features"={{.*}} }
// CHECK: attributes #2 = { noreturn nounwind "target-features"={{.*}} }

View File

@ -14,7 +14,10 @@ int test1(int a) {
// Check that the noredzone flag is set on the generated functions.
// CHECK: void @__llvm_gcov_indirect_counter_increment(i32* %{{.*}}, i64** %{{.*}}) unnamed_addr noinline noredzone
// CHECK: void @__llvm_gcov_writeout() unnamed_addr noinline noredzone
// CHECK: void @__llvm_gcov_init() unnamed_addr noinline noredzone
// CHECK: void @__gcov_flush() unnamed_addr noinline noredzone
// CHECK: void @__llvm_gcov_indirect_counter_increment(i32* %{{.*}}, i64** %{{.*}}) unnamed_addr #1
// CHECK: void @__llvm_gcov_writeout() unnamed_addr #1
// CHECK: void @__llvm_gcov_init() unnamed_addr #1
// CHECK: void @__gcov_flush() unnamed_addr #1
// CHECK: attributes #0 = { noredzone nounwind "target-features"={{.*}} }
// CHECK: attributes #1 = { noinline noredzone }

View File

@ -1,12 +1,12 @@
// RUN: %clang_cc1 -triple i386-unknown-unknown -emit-llvm -Os -o - %s | FileCheck %s
// CHECK: define signext i8 @f0(i32 %x) nounwind
// CHECK: define zeroext i8 @f1(i32 %x) nounwind
// CHECK: define void @f2(i8 signext %x) nounwind
// CHECK: define void @f3(i8 zeroext %x) nounwind
// CHECK: define signext i16 @f4(i32 %x) nounwind
// CHECK: define zeroext i16 @f5(i32 %x) nounwind
// CHECK: define void @f6(i16 signext %x) nounwind
// CHECK: define void @f7(i16 zeroext %x) nounwind
// CHECK: define signext i8 @f0(i32 %x) #0
// CHECK: define zeroext i8 @f1(i32 %x) #0
// CHECK: define void @f2(i8 signext %x) #0
// CHECK: define void @f3(i8 zeroext %x) #0
// CHECK: define signext i16 @f4(i32 %x) #0
// CHECK: define zeroext i16 @f5(i32 %x) #0
// CHECK: define void @f6(i16 signext %x) #0
// CHECK: define void @f7(i16 zeroext %x) #0
signed char f0(int x) { return x; }
@ -25,8 +25,7 @@ void f6(signed short x) { }
void f7(unsigned short x) { }
// CHECK: define void @f8()
// CHECK: alwaysinline
// CHECK: nounwind
// CHECK: #1
// CHECK: {
void __attribute__((always_inline)) f8(void) { }
@ -56,7 +55,7 @@ int f12(int arg) {
return arg ? 0 : f10_t();
}
// CHECK: define void @f13() nounwind optsize readnone
// CHECK: define void @f13() #0
void f13(void) __attribute__((pure)) __attribute__((const));
void f13(void){}
@ -83,21 +82,21 @@ void f14(int a) {
// <rdar://problem/7102668> [irgen] clang isn't setting the optsize bit on functions
// CHECK: define void @f15
// CHECK: optsize
// CHECK: #0
// CHECK: {
void f15(void) {
}
// PR5254
// CHECK: define void @f16
// CHECK: alignstack(16)
// CHECK: #6
// CHECK: {
void __attribute__((force_align_arg_pointer)) f16(void) {
}
// PR11038
// CHECK: define void @f18()
// CHECK: returns_twice
// CHECK: #7
// CHECK: {
// CHECK: call void @f17()
// CHECK: returns_twice
@ -117,3 +116,13 @@ int setjmp(jmp_buf);
void f19(void) {
setjmp(0);
}
// CHECK: attributes #0 = { nounwind optsize readnone "target-features"={{.*}} }
// CHECK: attributes #1 = { alwaysinline nounwind optsize readnone "target-features"={{.*}} }
// CHECK: attributes #2 = { noreturn nounwind optsize "target-features"={{.*}} }
// CHECK: attributes #3 = { noreturn optsize "target-features"={{.*}} }
// CHECK: attributes #4 = { nounwind optsize "target-features"={{.*}} }
// CHECK: attributes #5 = { optsize "target-features"={{.*}} }
// CHECK: attributes #6 = { nounwind optsize readnone alignstack=16 "target-features"={{.*}} }
// CHECK: attributes #7 = { nounwind optsize returns_twice "target-features"={{.*}} }
// CHECK: attributes #8 = { optsize returns_twice "target-features"={{.*}}

View File

@ -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) #0 {
struct test10_B;
typedef struct test10_B test10_F3(double);
void test10_foo(test10_F3 p1);
@ -15,3 +15,5 @@ void test10_foo(test10_F3 p1)
{
p1(0.0);
}
// CHECK: attributes #0 = { nounwind "target-features"={{.*}} }

View File

@ -86,106 +86,111 @@ void *use[] = {
sqrtf, tan, tanl, tanf, trunc, truncl, truncf
};
// CHECK-NOERRNO: declare double @acos(double) nounwind readnone
// CHECK-NOERRNO: declare x86_fp80 @acosl(x86_fp80) nounwind readnone
// CHECK-NOERRNO: declare float @acosf(float) nounwind readnone
// CHECK-NOERRNO: declare double @asin(double) nounwind readnone
// CHECK-NOERRNO: declare x86_fp80 @asinl(x86_fp80) nounwind readnone
// CHECK-NOERRNO: declare float @asinf(float) nounwind readnone
// CHECK-NOERRNO: declare double @atan(double) nounwind readnone
// CHECK-NOERRNO: declare x86_fp80 @atanl(x86_fp80) nounwind readnone
// CHECK-NOERRNO: declare float @atanf(float) nounwind readnone
// CHECK-NOERRNO: declare double @atan2(double, double) nounwind readnone
// CHECK-NOERRNO: declare x86_fp80 @atan2l(x86_fp80, x86_fp80) nounwind readnone
// CHECK-NOERRNO: declare float @atan2f(float, float) nounwind readnone
// CHECK-NOERRNO: declare double @ceil(double) nounwind readnone
// CHECK-NOERRNO: declare x86_fp80 @ceill(x86_fp80) nounwind readnone
// CHECK-NOERRNO: declare float @ceilf(float) nounwind readnone
// CHECK-NOERRNO: declare double @copysign(double, double) nounwind readnone
// CHECK-NOERRNO: declare x86_fp80 @copysignl(x86_fp80, x86_fp80) nounwind readnone
// CHECK-NOERRNO: declare float @copysignf(float, float) nounwind readnone
// CHECK-NOERRNO: declare double @cos(double) nounwind readnone
// CHECK-NOERRNO: declare x86_fp80 @cosl(x86_fp80) nounwind readnone
// CHECK-NOERRNO: declare float @cosf(float) nounwind readnone
// CHECK-NOERRNO: declare double @exp(double) nounwind readnone
// CHECK-NOERRNO: declare x86_fp80 @expl(x86_fp80) nounwind readnone
// CHECK-NOERRNO: declare float @expf(float) nounwind readnone
// CHECK-NOERRNO: declare double @exp2(double) nounwind readnone
// CHECK-NOERRNO: declare x86_fp80 @exp2l(x86_fp80) nounwind readnone
// CHECK-NOERRNO: declare float @exp2f(float) nounwind readnone
// CHECK-NOERRNO: declare double @fabs(double) nounwind readnone
// CHECK-NOERRNO: declare x86_fp80 @fabsl(x86_fp80) nounwind readnone
// CHECK-NOERRNO: declare float @fabsf(float) nounwind readnone
// CHECK-NOERRNO: declare double @floor(double) nounwind readnone
// CHECK-NOERRNO: declare x86_fp80 @floorl(x86_fp80) nounwind readnone
// CHECK-NOERRNO: declare float @floorf(float) nounwind readnone
// CHECK-NOERRNO: declare double @fma(double, double, double) nounwind readnone
// CHECK-NOERRNO: declare x86_fp80 @fmal(x86_fp80, x86_fp80, x86_fp80) nounwind readnone
// CHECK-NOERRNO: declare float @fmaf(float, float, float) nounwind readnone
// CHECK-NOERRNO: declare double @fmax(double, double) nounwind readnone
// CHECK-NOERRNO: declare x86_fp80 @fmaxl(x86_fp80, x86_fp80) nounwind readnone
// CHECK-NOERRNO: declare float @fmaxf(float, float) nounwind readnone
// CHECK-NOERRNO: declare double @fmin(double, double) nounwind readnone
// CHECK-NOERRNO: declare x86_fp80 @fminl(x86_fp80, x86_fp80) nounwind readnone
// CHECK-NOERRNO: declare float @fminf(float, float) nounwind readnone
// CHECK-NOERRNO: declare double @log(double) nounwind readnone
// CHECK-NOERRNO: declare x86_fp80 @logl(x86_fp80) nounwind readnone
// CHECK-NOERRNO: declare float @logf(float) nounwind readnone
// CHECK-NOERRNO: declare double @log2(double) nounwind readnone
// CHECK-NOERRNO: declare x86_fp80 @log2l(x86_fp80) nounwind readnone
// CHECK-NOERRNO: declare float @log2f(float) nounwind readnone
// CHECK-NOERRNO: declare double @nearbyint(double) nounwind readnone
// CHECK-NOERRNO: declare x86_fp80 @nearbyintl(x86_fp80) nounwind readnone
// CHECK-NOERRNO: declare float @nearbyintf(float) nounwind readnone
// CHECK-NOERRNO: declare double @pow(double, double) nounwind readnone
// CHECK-NOERRNO: declare x86_fp80 @powl(x86_fp80, x86_fp80) nounwind readnone
// CHECK-NOERRNO: declare float @powf(float, float) nounwind readnone
// CHECK-NOERRNO: declare double @rint(double) nounwind readnone
// CHECK-NOERRNO: declare x86_fp80 @rintl(x86_fp80) nounwind readnone
// CHECK-NOERRNO: declare float @rintf(float) nounwind readnone
// CHECK-NOERRNO: declare double @round(double) nounwind readnone
// CHECK-NOERRNO: declare x86_fp80 @roundl(x86_fp80) nounwind readnone
// CHECK-NOERRNO: declare float @roundf(float) nounwind readnone
// CHECK-NOERRNO: declare double @sin(double) nounwind readnone
// CHECK-NOERRNO: declare x86_fp80 @sinl(x86_fp80) nounwind readnone
// CHECK-NOERRNO: declare float @sinf(float) nounwind readnone
// CHECK-NOERRNO: declare double @sqrt(double) nounwind readnone
// CHECK-NOERRNO: declare x86_fp80 @sqrtl(x86_fp80) nounwind readnone
// CHECK-NOERRNO: declare float @sqrtf(float) nounwind readnone
// CHECK-NOERRNO: declare double @tan(double) nounwind readnone
// CHECK-NOERRNO: declare x86_fp80 @tanl(x86_fp80) nounwind readnone
// CHECK-NOERRNO: declare float @tanf(float) nounwind readnone
// CHECK-NOERRNO: declare double @trunc(double) nounwind readnone
// CHECK-NOERRNO: declare x86_fp80 @truncl(x86_fp80) nounwind readnone
// CHECK-NOERRNO: declare float @truncf(float) nounwind readnone
// CHECK-NOERRNO: declare double @acos(double) #0
// CHECK-NOERRNO: declare x86_fp80 @acosl(x86_fp80) #0
// CHECK-NOERRNO: declare float @acosf(float) #0
// CHECK-NOERRNO: declare double @asin(double) #0
// CHECK-NOERRNO: declare x86_fp80 @asinl(x86_fp80) #0
// CHECK-NOERRNO: declare float @asinf(float) #0
// CHECK-NOERRNO: declare double @atan(double) #0
// CHECK-NOERRNO: declare x86_fp80 @atanl(x86_fp80) #0
// CHECK-NOERRNO: declare float @atanf(float) #0
// CHECK-NOERRNO: declare double @atan2(double, double) #0
// CHECK-NOERRNO: declare x86_fp80 @atan2l(x86_fp80, x86_fp80) #0
// CHECK-NOERRNO: declare float @atan2f(float, float) #0
// CHECK-NOERRNO: declare double @ceil(double) #0
// CHECK-NOERRNO: declare x86_fp80 @ceill(x86_fp80) #0
// CHECK-NOERRNO: declare float @ceilf(float) #0
// CHECK-NOERRNO: declare double @copysign(double, double) #0
// CHECK-NOERRNO: declare x86_fp80 @copysignl(x86_fp80, x86_fp80) #0
// CHECK-NOERRNO: declare float @copysignf(float, float) #0
// CHECK-NOERRNO: declare double @cos(double) #0
// CHECK-NOERRNO: declare x86_fp80 @cosl(x86_fp80) #0
// CHECK-NOERRNO: declare float @cosf(float) #0
// CHECK-NOERRNO: declare double @exp(double) #0
// CHECK-NOERRNO: declare x86_fp80 @expl(x86_fp80) #0
// CHECK-NOERRNO: declare float @expf(float) #0
// CHECK-NOERRNO: declare double @exp2(double) #0
// CHECK-NOERRNO: declare x86_fp80 @exp2l(x86_fp80) #0
// CHECK-NOERRNO: declare float @exp2f(float) #0
// CHECK-NOERRNO: declare double @fabs(double) #0
// CHECK-NOERRNO: declare x86_fp80 @fabsl(x86_fp80) #0
// CHECK-NOERRNO: declare float @fabsf(float) #0
// CHECK-NOERRNO: declare double @floor(double) #0
// CHECK-NOERRNO: declare x86_fp80 @floorl(x86_fp80) #0
// CHECK-NOERRNO: declare float @floorf(float) #0
// CHECK-NOERRNO: declare double @fma(double, double, double) #0
// CHECK-NOERRNO: declare x86_fp80 @fmal(x86_fp80, x86_fp80, x86_fp80) #0
// CHECK-NOERRNO: declare float @fmaf(float, float, float) #0
// CHECK-NOERRNO: declare double @fmax(double, double) #0
// CHECK-NOERRNO: declare x86_fp80 @fmaxl(x86_fp80, x86_fp80) #0
// CHECK-NOERRNO: declare float @fmaxf(float, float) #0
// CHECK-NOERRNO: declare double @fmin(double, double) #0
// CHECK-NOERRNO: declare x86_fp80 @fminl(x86_fp80, x86_fp80) #0
// CHECK-NOERRNO: declare float @fminf(float, float) #0
// CHECK-NOERRNO: declare double @log(double) #0
// CHECK-NOERRNO: declare x86_fp80 @logl(x86_fp80) #0
// CHECK-NOERRNO: declare float @logf(float) #0
// CHECK-NOERRNO: declare double @log2(double) #0
// CHECK-NOERRNO: declare x86_fp80 @log2l(x86_fp80) #0
// CHECK-NOERRNO: declare float @log2f(float) #0
// CHECK-NOERRNO: declare double @nearbyint(double) #0
// CHECK-NOERRNO: declare x86_fp80 @nearbyintl(x86_fp80) #0
// CHECK-NOERRNO: declare float @nearbyintf(float) #0
// CHECK-NOERRNO: declare double @pow(double, double) #0
// CHECK-NOERRNO: declare x86_fp80 @powl(x86_fp80, x86_fp80) #0
// CHECK-NOERRNO: declare float @powf(float, float) #0
// CHECK-NOERRNO: declare double @rint(double) #0
// CHECK-NOERRNO: declare x86_fp80 @rintl(x86_fp80) #0
// CHECK-NOERRNO: declare float @rintf(float) #0
// CHECK-NOERRNO: declare double @round(double) #0
// CHECK-NOERRNO: declare x86_fp80 @roundl(x86_fp80) #0
// CHECK-NOERRNO: declare float @roundf(float) #0
// CHECK-NOERRNO: declare double @sin(double) #0
// CHECK-NOERRNO: declare x86_fp80 @sinl(x86_fp80) #0
// CHECK-NOERRNO: declare float @sinf(float) #0
// CHECK-NOERRNO: declare double @sqrt(double) #0
// CHECK-NOERRNO: declare x86_fp80 @sqrtl(x86_fp80) #0
// CHECK-NOERRNO: declare float @sqrtf(float) #0
// CHECK-NOERRNO: declare double @tan(double) #0
// CHECK-NOERRNO: declare x86_fp80 @tanl(x86_fp80) #0
// CHECK-NOERRNO: declare float @tanf(float) #0
// CHECK-NOERRNO: declare double @trunc(double) #0
// CHECK-NOERRNO: declare x86_fp80 @truncl(x86_fp80) #0
// CHECK-NOERRNO: declare float @truncf(float) #0
// CHECK-ERRNO: declare double @ceil(double) nounwind readnone
// CHECK-ERRNO: declare x86_fp80 @ceill(x86_fp80) nounwind readnone
// CHECK-ERRNO: declare float @ceilf(float) nounwind readnone
// CHECK-ERRNO: declare double @copysign(double, double) nounwind readnone
// CHECK-ERRNO: declare x86_fp80 @copysignl(x86_fp80, x86_fp80) nounwind readnone
// CHECK-ERRNO: declare float @copysignf(float, float) nounwind readnone
// CHECK-ERRNO: declare double @fabs(double) nounwind readnone
// CHECK-ERRNO: declare x86_fp80 @fabsl(x86_fp80) nounwind readnone
// CHECK-ERRNO: declare float @fabsf(float) nounwind readnone
// CHECK-ERRNO: declare double @floor(double) nounwind readnone
// CHECK-ERRNO: declare x86_fp80 @floorl(x86_fp80) nounwind readnone
// CHECK-ERRNO: declare float @floorf(float) nounwind readnone
// CHECK-ERRNO: declare double @fmax(double, double) nounwind readnone
// CHECK-ERRNO: declare x86_fp80 @fmaxl(x86_fp80, x86_fp80) nounwind readnone
// CHECK-ERRNO: declare float @fmaxf(float, float) nounwind readnone
// CHECK-ERRNO: declare double @fmin(double, double) nounwind readnone
// CHECK-ERRNO: declare x86_fp80 @fminl(x86_fp80, x86_fp80) nounwind readnone
// CHECK-ERRNO: declare float @fminf(float, float) nounwind readnone
// CHECK-ERRNO: declare double @nearbyint(double) nounwind readnone
// CHECK-ERRNO: declare x86_fp80 @nearbyintl(x86_fp80) nounwind readnone
// CHECK-ERRNO: declare float @nearbyintf(float) nounwind readnone
// CHECK-ERRNO: declare double @rint(double) nounwind readnone
// CHECK-ERRNO: declare x86_fp80 @rintl(x86_fp80) nounwind readnone
// CHECK-ERRNO: declare float @rintf(float) nounwind readnone
// CHECK-ERRNO: declare double @round(double) nounwind readnone
// CHECK-ERRNO: declare x86_fp80 @roundl(x86_fp80) nounwind readnone
// CHECK-ERRNO: declare float @roundf(float) nounwind readnone
// CHECK-ERRNO: declare double @trunc(double) nounwind readnone
// CHECK-ERRNO: declare x86_fp80 @truncl(x86_fp80) nounwind readnone
// CHECK-ERRNO: declare float @truncf(float) nounwind readnone
// CHECK-ERRNO: declare double @ceil(double) #1
// CHECK-ERRNO: declare x86_fp80 @ceill(x86_fp80) #1
// CHECK-ERRNO: declare float @ceilf(float) #1
// CHECK-ERRNO: declare double @copysign(double, double) #1
// CHECK-ERRNO: declare x86_fp80 @copysignl(x86_fp80, x86_fp80) #1
// CHECK-ERRNO: declare float @copysignf(float, float) #1
// CHECK-ERRNO: declare double @fabs(double) #1
// CHECK-ERRNO: declare x86_fp80 @fabsl(x86_fp80) #1
// CHECK-ERRNO: declare float @fabsf(float) #1
// CHECK-ERRNO: declare double @floor(double) #1
// CHECK-ERRNO: declare x86_fp80 @floorl(x86_fp80) #1
// CHECK-ERRNO: declare float @floorf(float) #1
// CHECK-ERRNO: declare double @fmax(double, double) #1
// CHECK-ERRNO: declare x86_fp80 @fmaxl(x86_fp80, x86_fp80) #1
// CHECK-ERRNO: declare float @fmaxf(float, float) #1
// CHECK-ERRNO: declare double @fmin(double, double) #1
// CHECK-ERRNO: declare x86_fp80 @fminl(x86_fp80, x86_fp80) #1
// CHECK-ERRNO: declare float @fminf(float, float) #1
// CHECK-ERRNO: declare double @nearbyint(double) #1
// CHECK-ERRNO: declare x86_fp80 @nearbyintl(x86_fp80) #1
// CHECK-ERRNO: declare float @nearbyintf(float) #1
// CHECK-ERRNO: declare double @rint(double) #1
// CHECK-ERRNO: declare x86_fp80 @rintl(x86_fp80) #1
// CHECK-ERRNO: declare float @rintf(float) #1
// CHECK-ERRNO: declare double @round(double) #1
// CHECK-ERRNO: declare x86_fp80 @roundl(x86_fp80) #1
// CHECK-ERRNO: declare float @roundf(float) #1
// CHECK-ERRNO: declare double @trunc(double) #1
// CHECK-ERRNO: declare x86_fp80 @truncl(x86_fp80) #1
// CHECK-ERRNO: declare float @truncf(float) #1
// CHECK-NOERRNO: attributes #0 = { nounwind readnone "target-features"={{.*}} }
// CHECK-ERRNO: attributes #0 = { "target-features"={{.*}} }
// CHECK-ERRNO: attributes #1 = { nounwind readnone "target-features"={{.*}} }

View File

@ -24,9 +24,9 @@ void test_sqrt(float a0, double a1, long double a2) {
// CHECK-YES: declare float @sqrtf(float)
// CHECK-YES: declare double @sqrt(double)
// CHECK-YES: declare x86_fp80 @sqrtl(x86_fp80)
// CHECK-NO: declare float @sqrtf(float) nounwind readnone
// CHECK-NO: declare double @sqrt(double) nounwind readnone
// CHECK-NO: declare x86_fp80 @sqrtl(x86_fp80) nounwind readnone
// CHECK-NO: declare float @sqrtf(float) #1
// CHECK-NO: declare double @sqrt(double) #1
// CHECK-NO: declare x86_fp80 @sqrtl(x86_fp80) #1
// CHECK-YES: define void @test_pow
// CHECK-NO: define void @test_pow
@ -47,9 +47,9 @@ void test_pow(float a0, double a1, long double a2) {
// CHECK-YES: declare float @powf(float, float)
// CHECK-YES: declare double @pow(double, double)
// CHECK-YES: declare x86_fp80 @powl(x86_fp80, x86_fp80)
// CHECK-NO: declare float @llvm.pow.f32(float, float) nounwind readonly
// CHECK-NO: declare double @llvm.pow.f64(double, double) nounwind readonly
// CHECK-NO: declare x86_fp80 @llvm.pow.f80(x86_fp80, x86_fp80) nounwind readonly
// CHECK-NO: declare float @llvm.pow.f32(float, float) #2
// CHECK-NO: declare double @llvm.pow.f64(double, double) #2
// CHECK-NO: declare x86_fp80 @llvm.pow.f80(x86_fp80, x86_fp80) #2
// CHECK-YES: define void @test_fma
// CHECK-NO: define void @test_fma
@ -67,12 +67,12 @@ void test_fma(float a0, double a1, long double a2) {
long double l2 = fmal(a2, a2, a2);
}
// CHECK-YES: declare float @llvm.fma.f32(float, float, float) nounwind readnone
// CHECK-YES: declare double @llvm.fma.f64(double, double, double) nounwind readnone
// CHECK-YES: declare x86_fp80 @llvm.fma.f80(x86_fp80, x86_fp80, x86_fp80) nounwind readnone
// CHECK-NO: declare float @llvm.fma.f32(float, float, float) nounwind readnone
// CHECK-NO: declare double @llvm.fma.f64(double, double, double) nounwind readnone
// CHECK-NO: declare x86_fp80 @llvm.fma.f80(x86_fp80, x86_fp80, x86_fp80) nounwind readnone
// CHECK-YES: declare float @llvm.fma.f32(float, float, float) #2
// CHECK-YES: declare double @llvm.fma.f64(double, double, double) #2
// CHECK-YES: declare x86_fp80 @llvm.fma.f80(x86_fp80, x86_fp80, x86_fp80) #2
// CHECK-NO: declare float @llvm.fma.f32(float, float, float) #3
// CHECK-NO: declare double @llvm.fma.f64(double, double, double) #3
// CHECK-NO: declare x86_fp80 @llvm.fma.f80(x86_fp80, x86_fp80, x86_fp80) #3
// Just checking to make sure these library functions are marked readnone
void test_builtins(double d, float f, long double ld) {
@ -81,40 +81,49 @@ void test_builtins(double d, float f, long double ld) {
double atan_ = atan(d);
long double atanl_ = atanl(ld);
float atanf_ = atanf(f);
// CHECK-NO: declare double @atan(double) nounwind readnone
// CHECK-NO: declare x86_fp80 @atanl(x86_fp80) nounwind readnone
// CHECK-NO: declare float @atanf(float) nounwind readnone
// CHECK-YES-NOT: declare double @atan(double) nounwind readnone
// CHECK-YES-NOT: declare x86_fp80 @atanl(x86_fp80) nounwind readnone
// CHECK-YES-NOT: declare float @atanf(float) nounwind readnone
// CHECK-NO: declare double @atan(double) #1
// CHECK-NO: declare x86_fp80 @atanl(x86_fp80) #1
// CHECK-NO: declare float @atanf(float) #1
// CHECK-YES-NOT: declare double @atan(double) #2
// CHECK-YES-NOT: declare x86_fp80 @atanl(x86_fp80) #2
// CHECK-YES-NOT: declare float @atanf(float) #2
double atan2_ = atan2(d, 2);
long double atan2l_ = atan2l(ld, ld);
float atan2f_ = atan2f(f, f);
// CHECK-NO: declare double @atan2(double, double) nounwind readnone
// CHECK-NO: declare x86_fp80 @atan2l(x86_fp80, x86_fp80) nounwind readnone
// CHECK-NO: declare float @atan2f(float, float) nounwind readnone
// CHECK-YES-NOT: declare double @atan2(double, double) nounwind readnone
// CHECK-YES-NOT: declare x86_fp80 @atan2l(x86_fp80, x86_fp80) nounwind readnone
// CHECK-YES-NOT: declare float @atan2f(float, float) nounwind readnone
// CHECK-NO: declare double @atan2(double, double) #1
// CHECK-NO: declare x86_fp80 @atan2l(x86_fp80, x86_fp80) #1
// CHECK-NO: declare float @atan2f(float, float) #1
// CHECK-YES-NOT: declare double @atan2(double, double) #2
// CHECK-YES-NOT: declare x86_fp80 @atan2l(x86_fp80, x86_fp80) #2
// CHECK-YES-NOT: declare float @atan2f(float, float) #2
double exp_ = exp(d);
long double expl_ = expl(ld);
float expf_ = expf(f);
// CHECK-NO: declare double @exp(double) nounwind readnone
// CHECK-NO: declare x86_fp80 @expl(x86_fp80) nounwind readnone
// CHECK-NO: declare float @expf(float) nounwind readnone
// CHECK-YES-NOT: declare double @exp(double) nounwind readnone
// CHECK-YES-NOT: declare x86_fp80 @expl(x86_fp80) nounwind readnone
// CHECK-YES-NOT: declare float @expf(float) nounwind readnone
// CHECK-NO: declare double @exp(double) #1
// CHECK-NO: declare x86_fp80 @expl(x86_fp80) #1
// CHECK-NO: declare float @expf(float) #1
// CHECK-YES-NOT: declare double @exp(double) #2
// CHECK-YES-NOT: declare x86_fp80 @expl(x86_fp80) #2
// CHECK-YES-NOT: declare float @expf(float) #2
double log_ = log(d);
long double logl_ = logl(ld);
float logf_ = logf(f);
// CHECK-NO: declare double @log(double) nounwind readnone
// CHECK-NO: declare x86_fp80 @logl(x86_fp80) nounwind readnone
// CHECK-NO: declare float @logf(float) nounwind readnone
// CHECK-YES-NOT: declare double @log(double) nounwind readnone
// CHECK-YES-NOT: declare x86_fp80 @logl(x86_fp80) nounwind readnone
// CHECK-YES-NOT: declare float @logf(float) nounwind readnone
// CHECK-NO: declare double @log(double) #1
// CHECK-NO: declare x86_fp80 @logl(x86_fp80) #1
// CHECK-NO: declare float @logf(float) #1
// CHECK-YES-NOT: declare double @log(double) #2
// CHECK-YES-NOT: declare x86_fp80 @logl(x86_fp80) #2
// CHECK-YES-NOT: declare float @logf(float) #2
}
// CHECK-YES: attributes #0 = { nounwind "target-features"={{.*}} }
// CHECK-YES: attributes #1 = { "target-features"={{.*}} }
// CHECK-YES: attributes #2 = { nounwind readnone }
// CHECK-NO: attributes #0 = { nounwind "target-features"={{.*}} }
// CHECK-NO: attributes #1 = { nounwind readnone "target-features"={{.*}} }
// CHECK-NO: attributes #2 = { nounwind readonly }
// CHECK-NO: attributes #3 = { nounwind readnone }

View File

@ -8,21 +8,26 @@
typedef float v4sf __attribute__ ((__vector_size__ (16)));
typedef int v4i32 __attribute__ ((__vector_size__ (16)));
// O32: define void @test_v4sf(i32 %a1.coerce0, i32 %a1.coerce1, i32 %a1.coerce2, i32 %a1.coerce3, i32 %a2, i32, i32 %a3.coerce0, i32 %a3.coerce1, i32 %a3.coerce2, i32 %a3.coerce3) nounwind
// O32: define void @test_v4sf(i32 %a1.coerce0, i32 %a1.coerce1, i32 %a1.coerce2, i32 %a1.coerce3, i32 %a2, i32, i32 %a3.coerce0, i32 %a3.coerce1, i32 %a3.coerce2, i32 %a3.coerce3) #0
// O32: declare i32 @test_v4sf_2(i32, i32, i32, i32, i32, i32, i32, i32, i32, i32)
// N64: define void @test_v4sf(i64 %a1.coerce0, i64 %a1.coerce1, i32 %a2, i64, i64 %a3.coerce0, i64 %a3.coerce1) nounwind
// N64: define void @test_v4sf(i64 %a1.coerce0, i64 %a1.coerce1, i32 %a2, i64, i64 %a3.coerce0, i64 %a3.coerce1) #0
// N64: declare i32 @test_v4sf_2(i64, i64, i32, i64, i64, i64)
extern test_v4sf_2(v4sf, int, v4sf);
void test_v4sf(v4sf a1, int a2, v4sf a3) {
test_v4sf_2(a3, a2, a1);
}
// O32: define void @test_v4i32(i32 %a1.coerce0, i32 %a1.coerce1, i32 %a1.coerce2, i32 %a1.coerce3, i32 %a2, i32, i32 %a3.coerce0, i32 %a3.coerce1, i32 %a3.coerce2, i32 %a3.coerce3) nounwind
// O32: define void @test_v4i32(i32 %a1.coerce0, i32 %a1.coerce1, i32 %a1.coerce2, i32 %a1.coerce3, i32 %a2, i32, i32 %a3.coerce0, i32 %a3.coerce1, i32 %a3.coerce2, i32 %a3.coerce3) #0
// O32: declare i32 @test_v4i32_2(i32, i32, i32, i32, i32, i32, i32, i32, i32, i32)
// N64: define void @test_v4i32(i64 %a1.coerce0, i64 %a1.coerce1, i32 %a2, i64, i64 %a3.coerce0, i64 %a3.coerce1) nounwind
// N64: define void @test_v4i32(i64 %a1.coerce0, i64 %a1.coerce1, i32 %a2, i64, i64 %a3.coerce0, i64 %a3.coerce1) #0
// N64: declare i32 @test_v4i32_2(i64, i64, i32, i64, i64, i64)
extern test_v4i32_2(v4i32, int, v4i32);
void test_v4i32(v4i32 a1, int a2, v4i32 a3) {
test_v4i32_2(a3, a2, a1);
}
// O32: attributes #0 = { nounwind "target-cpu"={{.*}} "target-features"={{.*}} }
// O32: attributes #1 = { "target-cpu"={{.*}} "target-features"={{.*}} }
// N64: attributes #0 = { nounwind "target-cpu"={{.*}} "target-features"={{.*}} }
// N64: attributes #1 = { "target-cpu"={{.*}} "target-features"={{.*}} }

View File

@ -2,7 +2,7 @@
void baz(int arg);
// CHECK: define x86_stdcallcc void @foo(i32 %arg) nounwind
// CHECK: define x86_stdcallcc void @foo(i32 %arg) #0
void foo(int arg) {
// CHECK: call x86_stdcallcc i32 bitcast (i32 (...)* @bar to i32 (i32)*)(
bar(arg);
@ -13,3 +13,6 @@ void foo(int arg) {
// CHECK: declare x86_stdcallcc i32 @bar(...)
// CHECK: declare x86_stdcallcc void @baz(i32)
// CHECK: attributes #0 = { nounwind "target-features"={{.*}} }
// CHECK: attributes #1 = { "target-features"={{.*}} }

View File

@ -8,17 +8,21 @@ union { struct S s; } u;
// CHECK: @u = {{.*}}zeroinitializer, align 16
// CHECK: define void @t3() naked noinline nounwind {{.*}} {
// CHECK: define void @t3() #0 {
__declspec(naked) void t3() {}
// CHECK: define void @t22() nounwind
// CHECK: define void @t22() #1
void __declspec(nothrow) t22();
void t22() {}
// CHECK: define void @t2() noinline nounwind {{.*}} {
// CHECK: define void @t2() #2 {
__declspec(noinline) void t2() {}
// CHECK: call void @f20_t()
// CHECK: noreturn
// CHECK: call void @f20_t() noreturn
__declspec(noreturn) void f20_t(void);
void f20(void) { f20_t(); }
// CHECK: attributes #0 = { naked noinline nounwind "target-features"={{.*}} }
// CHECK: attributes #1 = { nounwind "target-features"={{.*}} }
// CHECK: attributes #2 = { noinline nounwind "target-features"={{.*}} }
// CHECK: attributes #3 = { noreturn "target-features"={{.*}} }

View File

@ -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.]+}}) #0 {
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.]+}}) #0 {
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.]+}}) #0 {
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.]+}}) #0 {
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.]+}}) #0 {
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.]+}}) #0 {
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.]+}}) #0 {
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.]+}}) #0 {
void bar_float(void) {
foo_float(2.0f - 2.5fi);
}
// CHECK: define void @bar_float() nounwind {{.*}} {
// CHECK: define void @bar_float() #0 {
// 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() #0 {
// 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() #0 {
// 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() #0 {
// 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() #0 {
// 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() #0 {
// 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() #0 {
// 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() #0 {
// 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
@ -180,3 +180,5 @@ void bar_long_long(void) {
// CHECK: %[[VAR76:[A-Za-z0-9.]+]] = getelementptr { i64, i64 }* %[[VAR71]], i32 0, i32 1
// CHECK: %[[VAR77:[A-Za-z0-9.]+]] = load i64* %[[VAR76]], align 1
// CHECK: %{{[A-Za-z0-9.]+}} = call i64 @foo_long_long(i64 %[[VAR75]], i64 %[[VAR77]])
// CHECK: attributes #0 = { nounwind "target-features"={{.*}} }

View File

@ -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.]+}}) #0 {
_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.]+}}) #0 {
_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.]+}}) #0 {
_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.]+}}) #0 {
_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.]+}}) #0 {
_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.]+}}) #0 {
_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.]+}}) #0 {
_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.]+}}) #0 {
float bar_float(void) {
return crealf(foo_float(2.0f - 2.5fi));
}
// CHECK: define float @bar_float() nounwind {{.*}} {
// CHECK: define float @bar_float() #0 {
// 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() #0 {
// 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() #0 {
// 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() #0 {
// 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() #0 {
// 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() #0 {
// 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() #0 {
// CHECK: [[VAR7:[%A-Za-z0-9.]+]] = call { i64, i64 } @foo_long
// CHECK: extractvalue { i64, i64 } [[VAR7]], 0
// CHECK: extractvalue { i64, i64 } [[VAR7]], 1
@ -120,8 +120,10 @@ 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() #0 {
// CHECK: [[VAR8:[%A-Za-z0-9.]+]] = call { i64, i64 } @foo_long_long
// CHECK: extractvalue { i64, i64 } [[VAR8]], 0
// CHECK: extractvalue { i64, i64 } [[VAR8]], 1
// CHECK: attributes #0 = { nounwind "target-features"={{.*}} }

View File

@ -2,14 +2,15 @@
// RUN: %clang_cc1 -O0 -triple powerpc64-unknown-linux-gnu -emit-llvm -o - %s | FileCheck %s
void f1(int x) { return; }
// CHECK: define void @f1(i32 signext %x) nounwind
// CHECK: define void @f1(i32 signext %x) #0
void f2(unsigned int x) { return; }
// CHECK: define void @f2(i32 zeroext %x) nounwind
// CHECK: define void @f2(i32 zeroext %x) #0
int f3(void) { return 0; }
// CHECK: define signext i32 @f3() nounwind
// CHECK: define signext i32 @f3() #0
unsigned int f4(void) { return 0; }
// CHECK: define zeroext i32 @f4() nounwind
// CHECK: define zeroext i32 @f4() #0
// CHECK: attributes #0 = { nounwind "target-features"={{.*}} }

View File

@ -136,7 +136,7 @@ void __both3(void) {}
void __a1(void) __attribute((noinline));
#pragma weak a1 = __a1
void __a1(void) {}
// CHECK: define void @__a1() noinline
// CHECK: define void @__a1() #1
// attributes introduced BEFORE a combination of #pragma weak and alias()
// hold...
@ -144,11 +144,11 @@ void __a3(void) __attribute((noinline));
#pragma weak a3 = __a3
void a3(void) __attribute((alias("__a3")));
void __a3(void) {}
// CHECK: define void @__a3() noinline
// CHECK: define void @__a3() #1
#pragma weak xxx = __xxx
__attribute((pure,noinline,const,fastcall)) void __xxx(void) { }
// CHECK: void @__xxx() noinline
// CHECK: void @__xxx() #2
///////////// PR10878: Make sure we can call a weak alias
void SHA512Pad(void *context) {}
@ -179,3 +179,8 @@ void zzz(void){}
// CHECK: define void @yyy()
int correct_linkage;
// CHECK: attributes #0 = { nounwind "target-features"={{.*}} }
// CHECK: attributes #1 = { noinline nounwind "target-features"={{.*}} }
// CHECK: attributes #2 = { noinline nounwind readnone "target-features"={{.*}} }
// CHECK: attributes #3 = { "target-features"={{.*}} }

View File

@ -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) #0 {
// 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) #0 {
// 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) #0 {
typedef __SIZE_TYPE__ size_t;
@ -16,3 +16,15 @@ void test1(const char *msg) {
strcpy(a, msg);
printf("%s\n", a);
}
// NOSSP: attributes #0 = { nounwind "target-features"={{.*}} }
// NOSSP: attributes #1 = { "target-features"={{.*}} }
// NOSSP: attributes #2 = { nounwind }
// WITHSSP: attributes #0 = { nounwind ssp "target-features"={{.*}} }
// WITHSSP: attributes #1 = { "target-features"={{.*}} }
// WITHSSP: attributes #2 = { nounwind }
// SSPREQ: attributes #0 = { nounwind sspreq "target-features"={{.*}} }
// SSPREQ: attributes #1 = { "target-features"={{.*}} }
// SSPREQ: attributes #2 = { nounwind }

View File

@ -16,9 +16,13 @@ void __attribute__((pure)) f5(T1 a);
void *ps[] = { f0, f1, f2, f3, f4, f5 };
// CHECK: declare i32 @f0() nounwind readnone
// CHECK: declare i32 @f1() nounwind readonly
// CHECK: declare i32 @f0() #0
// CHECK: declare i32 @f1() #1
// CHECK: declare void @f2({{.*}} sret)
// CHECK: declare void @f3({{.*}} sret)
// CHECK: declare void @f4({{.*}} byval align 4)
// CHECK: declare void @f5({{.*}} byval align 4)
// CHECK: attributes #0 = { nounwind readnone "target-features"={{.*}} }
// CHECK: attributes #1 = { nounwind readonly "target-features"={{.*}} }
// CHECK: attributes #2 = { nounwind "target-features"={{.*}} }

View File

@ -3,22 +3,28 @@
int opaque();
// CHECK: define [[INT:i.*]] @test0() "target-features"={{.*}} {
// CHECK-NOEXC: define [[INT:i.*]] @test0() nounwind{{.*}} {
// CHECK: define [[INT:i.*]] @test0() #0 {
// CHECK-NOEXC: define [[INT:i.*]] @test0() #0 {
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() #1 {
// CHECK-NOEXC: define [[INT:i.*]] @test1() #0 {
int test1(void) {
return 0;
}
// <rdar://problem/8283071>: not for weak functions
// CHECK: define weak [[INT:i.*]] @test2() "target-features"={{.*}} {
// CHECK-NOEXC: define weak [[INT:i.*]] @test2() nounwind{{.*}} {
// CHECK: define weak [[INT:i.*]] @test2() #0 {
// CHECK-NOEXC: define weak [[INT:i.*]] @test2() #0 {
__attribute__((weak)) int test2(void) {
return 0;
}
// CHECK: attributes #0 = { "target-features"={{.*}} }
// CHECK: attributes #1 = { nounwind "target-features"={{.*}} }
// CHECK-NOEXC: attributes #0 = { nounwind "target-features"={{.*}} }
// CHECK-NOEXC: attributes #1 = { "target-features"={{.*}} }

View File

@ -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"={{.*}} }

View File

@ -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"={{.*}} }

View File

@ -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 }

View File

@ -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 }

View File

@ -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"={{.*}} }

View File

@ -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"={{.*}} }

View File

@ -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 }

View File

@ -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 }

View File

@ -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"={{.*}} }

View File

@ -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 }

View File

@ -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"={{.*}} }

View File

@ -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"={{.*}} }

View File

@ -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"={{.*}} }

View File

@ -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"={{.*}} }

View File

@ -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"={{.*}} }

View File

@ -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 }

View File

@ -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"={{.*}} }

View File

@ -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"={{.*}} }

View File

@ -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"={{.*}} }

View File

@ -42,3 +42,6 @@ const char *f() {
}
}
// CHECK: attributes #0 = { "target-features"={{.*}} }
// CHECK: attributes #1 = { nounwind "target-features"={{.*}} }

View File

@ -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"={{.*}} }

View File

@ -9,7 +9,7 @@
// ARC-ALIEN: declare extern_weak i8* @objc_retain(i8*)
// ARC-ALIEN: declare extern_weak void @objc_storeStrong(i8**, i8*)
// ARC-ALIEN: declare extern_weak i8* @objc_autoreleaseReturnValue(i8*)
// ARC-ALIEN: declare i8* @objc_msgSend(i8*, i8*, ...) nonlazybind
// ARC-ALIEN: declare i8* @objc_msgSend(i8*, i8*, ...) #1
// ARC-ALIEN: declare extern_weak void @objc_release(i8*)
// ARC-ALIEN: declare extern_weak i8* @objc_retainAutoreleasedReturnValue(i8*)
// ARC-ALIEN: declare extern_weak i8* @objc_initWeak(i8**, i8*)
@ -19,11 +19,11 @@
// ARC-ALIEN: declare extern_weak i8* @objc_autorelease(i8*)
// ARC-ALIEN: declare extern_weak i8* @objc_retainAutorelease(i8*)
// ARC-NATIVE: declare i8* @objc_retain(i8*) nonlazybind
// ARC-NATIVE: declare i8* @objc_retain(i8*) #1
// ARC-NATIVE: declare void @objc_storeStrong(i8**, i8*)
// ARC-NATIVE: declare i8* @objc_autoreleaseReturnValue(i8*)
// ARC-NATIVE: declare i8* @objc_msgSend(i8*, i8*, ...) nonlazybind
// ARC-NATIVE: declare void @objc_release(i8*) nonlazybind
// ARC-NATIVE: declare i8* @objc_msgSend(i8*, i8*, ...) #1
// ARC-NATIVE: declare void @objc_release(i8*) #1
// ARC-NATIVE: declare i8* @objc_retainAutoreleasedReturnValue(i8*)
// ARC-NATIVE: declare i8* @objc_initWeak(i8**, i8*)
// ARC-NATIVE: declare i8* @objc_storeWeak(i8**, i8*)
@ -1483,3 +1483,8 @@ void test70(id i) {
[2] = i
};
}
// CHECK: attributes #0 = { nounwind "target-features"={{.*}} }
// CHECK: attributes #1 = { nonlazybind }
// CHECK: attributes #2 = { "target-features"={{.*}} }
// CHECK: attributes #3 = { nounwind }

View File

@ -6,7 +6,7 @@ void log(int i);
@class C;
// CHECK: define void @test0() "target-features"={{.*}} {
// CHECK: define void @test0() #0 {
void test0() {
@try {
// CHECK: invoke void @opaque()
@ -30,3 +30,6 @@ void test0() {
log(1);
}
// CHECK: attributes #0 = { "target-features"={{.*}} }
// CHECK: attributes #1 = { nounwind readnone }

View File

@ -1,6 +1,9 @@
// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o %t %s
// RUN: grep -F 'declare i8* @objc_msgSend(i8*, i8*, ...) nonlazybind' %t
// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm %s -o - | FileCheck %s
// CHECK: declare i8* @objc_msgSend(i8*, i8*, ...) #1
void f0(id x) {
[x foo];
}
// CHECK: attributes #0 = { nounwind "target-features"={{.*}} }
// CHECK: attributes #1 = { nonlazybind }

View File

@ -50,4 +50,7 @@ int main() {
#endif
}
// CHECK: declare i8* @objc_msgSend(i8*, i8*, ...) nonlazybind
// CHECK: declare i8* @objc_msgSend(i8*, i8*, ...) #1
// CHECK: attributes #0 = { nounwind "target-features"={{.*}} }
// CHECK: attributes #1 = { nonlazybind }

View File

@ -53,7 +53,7 @@ typedef signed char BOOL;
id NSUserName();
// CHECK: define i32 @main() nounwind
// CHECK: define i32 @main() #0
int main() {
// CHECK: call{{.*}}@objc_msgSend{{.*}}i8 signext 97
NSNumber *aNumber = @'a';
@ -93,3 +93,7 @@ extern void bar(foo a);
void baz(void) {
bar(^(void) { return YES; });
}
// CHECK: attributes #0 = { nounwind "target-features"={{.*}} }
// CHECK: attributes #1 = { nonlazybind }
// CHECK: attributes #2 = { "target-features"={{.*}} }

View File

@ -7,14 +7,15 @@
@implementation MyClass
// CHECK-NOT: +[MyClass load]{{.*}} address_safety
// CHECK: +[MyClass load]{{.*}}
// ASAN: +[MyClass load]{{.*}} address_safety
// CHECK: +[MyClass load]{{.*}}#0
// ASAN: +[MyClass load]{{.*}}#0
+(void) load { }
// CHECK-NOT: +[MyClass addressSafety:]{{.*}} address_safety
// CHECK: +[MyClass addressSafety:]{{.*}}
// ASAN: +[MyClass addressSafety:]{{.*}} address_safety
// CHECK: +[MyClass addressSafety:]{{.*}}#0
// ASAN: +[MyClass addressSafety:]{{.*}}#0
+ (int) addressSafety:(int*)a { return *a; }
@end
// CHECK: attributes #0 = { nounwind "target-features"={{.*}} }
// ASAN: attributes #0 = { address_safety nounwind "target-features"={{.*}} }

View File

@ -25,15 +25,24 @@ typedef int (^fp)();
fp global;
void f2() { global = []{ return 3; }; }
// MRC: define void @_Z2f2v() nounwind "target-features"={{.*}} {
// MRC: define void @_Z2f2v() #1 {
// 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 "target-features"={{.*}} {
// ARC: define void @_Z2f2v() #1 {
// ARC: store i8* bitcast (i32 (i8*)* @___Z2f2v_block_invoke to i8*),
// ARC: call i8* @objc_retainBlock
// ARC: call void @objc_release
// ARC: define internal i32 @___Z2f2v_block_invoke
// ARC: call i32 @"_ZZ2f2vENK3$_1clEv
// ARC: attributes #0 = { "target-features"={{.*}} }
// ARC: attributes #1 = { nounwind "target-features"={{.*}} }
// ARC: attributes #2 = { inlinehint nounwind "target-features"={{.*}} }
// MRC: attributes #0 = { "target-features"={{.*}} }
// MRC: attributes #1 = { nounwind "target-features"={{.*}} }
// MRC: attributes #2 = { inlinehint nounwind "target-features"={{.*}} }
// MRC: attributes #3 = { nonlazybind }

View File

@ -1,6 +1,6 @@
// RUN: %clang -target i386-apple-darwin9 -miphoneos-version-min=3.0 -arch armv7 -flto -S -o - %s | FileCheck %s
// CHECK: @f0() ssp
// CHECK: @f0() #0
// CHECK: @__f0_block_invoke
// CHECK: void @f1
// CHECK-NOT: msgSend_fixup_alloc
@ -26,3 +26,5 @@ void f1() {
[I1 alloc];
}
// CHECK: attributes #0 = { ssp "target-cpu"="cortex-a8" "target-features"="+neon" }
// CHECK: attributes #1 = { nonlazybind }

View File

@ -14,9 +14,12 @@
// CHECK-PRINT: oldObject = dictionary[key];
// CHECK-PRINT: dictionary[key] = newObject;
// CHECK-IR: define void @all() nounwind
// CHECK-IR: define void @all() #0
// CHECK-IR: {{call.*objc_msgSend}}
// CHECK-IR: {{call.*objc_msgSend}}
// CHECK-IR: {{call.*objc_msgSend}}
// CHECK-IR: {{call.*objc_msgSend}}
// CHECK-IR: ret void
// CHECK: attributes #0 = { nounwind {{.*}} }
// CHECK: attributes #1 = { nonlazybind }