aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGen')
-rw-r--r--test/CodeGen/2008-04-08-NoExceptions.c6
-rw-r--r--test/CodeGen/address-safety-attr.cpp48
-rw-r--r--test/CodeGen/function-attributes.c8
-rw-r--r--test/CodeGen/sanitize-thread-attr.cpp48
-rw-r--r--test/CodeGen/unwind-attr.c5
5 files changed, 63 insertions, 52 deletions
diff --git a/test/CodeGen/2008-04-08-NoExceptions.c b/test/CodeGen/2008-04-08-NoExceptions.c
index 254d30ac3c..1213492d1d 100644
--- a/test/CodeGen/2008-04-08-NoExceptions.c
+++ b/test/CodeGen/2008-04-08-NoExceptions.c
@@ -2,11 +2,11 @@
void f(void);
void g(void) {
- // CHECK: define void @g() #0
+ // CHECK: define void @g() [[NUW:#[0-9]+]]
// CHECK-NOT: call void @f() nounwind
f();
}
-// CHECK-NOT: declare void @f() #0
+// CHECK-NOT: declare void @f() [[NUW]]
-// CHECK: attributes #0 = { nounwind{{.*}} }
+// CHECK: attributes [[NUW]] = { nounwind{{.*}} }
diff --git a/test/CodeGen/address-safety-attr.cpp b/test/CodeGen/address-safety-attr.cpp
index 29ba5a8375..88f75a1d50 100644
--- a/test/CodeGen/address-safety-attr.cpp
+++ b/test/CodeGen/address-safety-attr.cpp
@@ -10,33 +10,33 @@
// when AddressSanitizer is enabled, unless no_sanitize_address attribute
// is present.
-// WITHOUT: NoAddressSafety1{{.*}}) #[[NOATTR:[0-9]+]]
-// BL: NoAddressSafety1{{.*}}) #[[NOATTR:[0-9]+]]
-// ASAN: NoAddressSafety1{{.*}}) #[[NOATTR:[0-9]+]]
+// WITHOUT: NoAddressSafety1{{.*}}) [[NOATTR:#[0-9]+]]
+// BL: NoAddressSafety1{{.*}}) [[NOATTR:#[0-9]+]]
+// ASAN: NoAddressSafety1{{.*}}) [[NOATTR:#[0-9]+]]
__attribute__((no_sanitize_address))
int NoAddressSafety1(int *a) { return *a; }
-// WITHOUT: NoAddressSafety2{{.*}}) #[[NOATTR]]
-// BL: NoAddressSafety2{{.*}}) #[[NOATTR]]
-// ASAN: NoAddressSafety2{{.*}}) #[[NOATTR]]
+// WITHOUT: NoAddressSafety2{{.*}}) [[NOATTR]]
+// BL: NoAddressSafety2{{.*}}) [[NOATTR]]
+// ASAN: NoAddressSafety2{{.*}}) [[NOATTR]]
__attribute__((no_sanitize_address))
int NoAddressSafety2(int *a);
int NoAddressSafety2(int *a) { return *a; }
-// WITHOUT: AddressSafetyOk{{.*}}) #[[NOATTR]]
-// BL: AddressSafetyOk{{.*}}) #[[NOATTR]]
-// ASAN: AddressSafetyOk{{.*}}) #[[WITH:[0-9]+]]
+// WITHOUT: AddressSafetyOk{{.*}}) [[NOATTR]]
+// BL: AddressSafetyOk{{.*}}) [[NOATTR]]
+// ASAN: AddressSafetyOk{{.*}}) [[WITH:#[0-9]+]]
int AddressSafetyOk(int *a) { return *a; }
-// WITHOUT: TemplateAddressSafetyOk{{.*}}) #[[NOATTR]]
-// BL: TemplateAddressSafetyOk{{.*}}) #[[NOATTR]]
-// ASAN: TemplateAddressSafetyOk{{.*}}) #[[WITH]]
+// WITHOUT: TemplateAddressSafetyOk{{.*}}) [[NOATTR]]
+// BL: TemplateAddressSafetyOk{{.*}}) [[NOATTR]]
+// ASAN: TemplateAddressSafetyOk{{.*}}) [[WITH]]
template<int i>
int TemplateAddressSafetyOk() { return i; }
-// WITHOUT: TemplateNoAddressSafety{{.*}}) #[[NOATTR]]
-// BL: TemplateNoAddressSafety{{.*}}) #[[NOATTR]]
-// ASAN: TemplateNoAddressSafety{{.*}}) #[[NOATTR]]
+// WITHOUT: TemplateNoAddressSafety{{.*}}) [[NOATTR]]
+// BL: TemplateNoAddressSafety{{.*}}) [[NOATTR]]
+// ASAN: TemplateNoAddressSafety{{.*}}) [[NOATTR]]
template<int i>
__attribute__((no_sanitize_address))
int TemplateNoAddressSafety() { return i; }
@@ -47,12 +47,16 @@ int force_instance = TemplateAddressSafetyOk<42>()
// Check that __cxx_global_var_init* get the sanitize_address attribute.
int global1 = 0;
int global2 = *(int*)((char*)&global1+1);
-// WITHOUT: @__cxx_global_var_init{{.*}}#[[NOATTR]]
-// BL: @__cxx_global_var_init{{.*}}#[[NOATTR]]
-// ASAN: @__cxx_global_var_init{{.*}}#[[WITH]]
+// WITHOUT: @__cxx_global_var_init{{.*}}[[NOATTR_NO_TF:#[0-9]+]]
+// BL: @__cxx_global_var_init{{.*}}[[NOATTR_NO_TF:#[0-9]+]]
+// ASAN: @__cxx_global_var_init{{.*}}[[WITH_NO_TF:#[0-9]+]]
-// WITHOUT: attributes #[[NOATTR]] = { nounwind{{.*}} }
-// BL: attributes #[[NOATTR]] = { nounwind{{.*}} }
+// WITHOUT: attributes [[NOATTR]] = { nounwind{{.*}} }
+// WITHOUT: attributes [[NOATTR_NO_TF]] = { nounwind }
-// ASAN: attributes #[[NOATTR]] = { nounwind{{.*}} }
-// ASAN: attributes #[[WITH]] = {{.*}}sanitize_address
+// BL: attributes [[NOATTR]] = { nounwind{{.*}} }
+// BL: attributes [[NOATTR_NO_TF]] = { nounwind }
+
+// ASAN: attributes [[NOATTR]] = { nounwind{{.*}} }
+// ASAN: attributes [[WITH]] = { nounwind sanitize_address{{.*}} }
+// ASAN: attributes [[WITH_NO_TF]] = { nounwind sanitize_address }
diff --git a/test/CodeGen/function-attributes.c b/test/CodeGen/function-attributes.c
index 8ad00fa80d..25ca9163a1 100644
--- a/test/CodeGen/function-attributes.c
+++ b/test/CodeGen/function-attributes.c
@@ -43,7 +43,7 @@ void f9b(void) { f9a(); }
// FIXME: We should be setting nounwind on calls.
// CHECK: call i32 @f10_t()
-// CHECK: [[NUW]]
+// CHECK: [[NUW_RN:#[0-9]+]]
// CHECK: {
int __attribute__((const)) f10_t(void);
int f10(void) { return f10_t(); }
@@ -119,6 +119,8 @@ void f19(void) {
// CHECK: attributes [[NUW]] = { nounwind optsize readnone{{.*}} }
// CHECK: attributes [[AI]] = { alwaysinline nounwind optsize readnone{{.*}} }
-// CHECK: attributes [[NR]] = { noreturn nounwind optsize }
// CHECK: attributes [[ALIGN]] = { nounwind optsize readnone alignstack=16{{.*}} }
-// CHECK: attributes [[RT]] = { nounwind optsize returns_twice }
+// CHECK: attributes [[RT]] = { nounwind optsize returns_twice{{.*}} }
+// CHECK: attributes [[NR]] = { noreturn nounwind optsize }
+// CHECK: attributes [[NUW_RN]] = { nounwind optsize readnone }
+// CHECK: attributes [[RT_CALL]] = { nounwind optsize returns_twice }
diff --git a/test/CodeGen/sanitize-thread-attr.cpp b/test/CodeGen/sanitize-thread-attr.cpp
index 2dec3c48c6..fe5d81026d 100644
--- a/test/CodeGen/sanitize-thread-attr.cpp
+++ b/test/CodeGen/sanitize-thread-attr.cpp
@@ -9,33 +9,33 @@
// when ThreadSanitizer is enabled, unless no_sanitize_thread attribute
// is present.
-// WITHOUT: NoTSAN1{{.*}}) #[[NOATTR:[0-9]+]]
-// BL: NoTSAN1{{.*}}) #[[NOATTR:[0-9]+]]
-// TSAN: NoTSAN1{{.*}}) #[[NOATTR:[0-9]+]]
+// WITHOUT: NoTSAN1{{.*}}) [[NOATTR:#[0-9]+]]
+// BL: NoTSAN1{{.*}}) [[NOATTR:#[0-9]+]]
+// TSAN: NoTSAN1{{.*}}) [[NOATTR:#[0-9]+]]
__attribute__((no_sanitize_thread))
int NoTSAN1(int *a) { return *a; }
-// WITHOUT: NoTSAN2{{.*}}) #[[NOATTR]]
-// BL: NoTSAN2{{.*}}) #[[NOATTR]]
-// TSAN: NoTSAN2{{.*}}) #[[NOATTR]]
+// WITHOUT: NoTSAN2{{.*}}) [[NOATTR]]
+// BL: NoTSAN2{{.*}}) [[NOATTR]]
+// TSAN: NoTSAN2{{.*}}) [[NOATTR]]
__attribute__((no_sanitize_thread))
int NoTSAN2(int *a);
int NoTSAN2(int *a) { return *a; }
-// WITHOUT: TSANOk{{.*}}) #[[NOATTR]]
-// BL: TSANOk{{.*}}) #[[NOATTR]]
-// TSAN: TSANOk{{.*}}) #[[WITH:[0-9]+]]
+// WITHOUT: TSANOk{{.*}}) [[NOATTR]]
+// BL: TSANOk{{.*}}) [[NOATTR]]
+// TSAN: TSANOk{{.*}}) [[WITH:#[0-9]+]]
int TSANOk(int *a) { return *a; }
-// WITHOUT: TemplateTSANOk{{.*}}) #[[NOATTR]]
-// BL: TemplateTSANOk{{.*}}) #[[NOATTR]]
-// TSAN: TemplateTSANOk{{.*}}) #[[WITH]]
+// WITHOUT: TemplateTSANOk{{.*}}) [[NOATTR]]
+// BL: TemplateTSANOk{{.*}}) [[NOATTR]]
+// TSAN: TemplateTSANOk{{.*}}) [[WITH]]
template<int i>
int TemplateTSANOk() { return i; }
-// WITHOUT: TemplateNoTSAN{{.*}}) #[[NOATTR]]
-// BL: TemplateNoTSAN{{.*}}) #[[NOATTR]]
-// TSAN: TemplateNoTSAN{{.*}}) #[[NOATTR]]
+// WITHOUT: TemplateNoTSAN{{.*}}) [[NOATTR]]
+// BL: TemplateNoTSAN{{.*}}) [[NOATTR]]
+// TSAN: TemplateNoTSAN{{.*}}) [[NOATTR]]
template<int i>
__attribute__((no_sanitize_thread))
int TemplateNoTSAN() { return i; }
@@ -46,12 +46,16 @@ int force_instance = TemplateTSANOk<42>()
// Check that __cxx_global_var_init* get the sanitize_thread attribute.
int global1 = 0;
int global2 = *(int*)((char*)&global1+1);
-// WITHOUT: @__cxx_global_var_init{{.*}}#[[NOATTR]]
-// BL: @__cxx_global_var_init{{.*}}#[[NOATTR]]
-// TSAN: @__cxx_global_var_init{{.*}}#[[WITH]]
+// WITHOUT: @__cxx_global_var_init{{.*}}[[NOATTR_NO_TF:#[0-9]+]]
+// BL: @__cxx_global_var_init{{.*}}[[NOATTR_NO_TF:#[0-9]+]]
+// TSAN: @__cxx_global_var_init{{.*}}[[WITH_NO_TF:#[0-9]+]]
-// WITHOUT: attributes #[[NOATTR]] = { nounwind{{.*}} }
-// BL: attributes #[[NOATTR]] = { nounwind{{.*}} }
+// WITHOUT: attributes [[NOATTR]] = { nounwind{{.*}} }
+// WITHOUT: attributes [[NOATTR_NO_TF]] = { nounwind }
-// TSAN: attributes #[[NOATTR]] = { nounwind{{.*}} }
-// TSAN: attributes #[[WITH]] = { nounwind{{.*}} sanitize_thread
+// BL: attributes [[NOATTR]] = { nounwind{{.*}} }
+// BL: attributes [[NOATTR_NO_TF]] = { nounwind{{.*}} }
+
+// TSAN: attributes [[NOATTR]] = { nounwind{{.*}} }
+// TSAN: attributes [[WITH]] = { nounwind sanitize_thread{{.*}} }
+// TSAN: attributes [[WITH_NO_TF]] = { nounwind sanitize_thread }
diff --git a/test/CodeGen/unwind-attr.c b/test/CodeGen/unwind-attr.c
index 1a7d3cdd1c..e505a6e9e2 100644
--- a/test/CodeGen/unwind-attr.c
+++ b/test/CodeGen/unwind-attr.c
@@ -3,7 +3,7 @@
int opaque();
-// CHECK: define [[INT:i.*]] @test0() {
+// CHECK: define [[INT:i.*]] @test0() [[TF:#[0-9]+]] {
// CHECK-NOEXC: define [[INT:i.*]] @test0() [[NUW:#[0-9]+]] {
int test0(void) {
return opaque();
@@ -17,12 +17,13 @@ int test1(void) {
}
// <rdar://problem/8283071>: not for weak functions
-// CHECK: define weak [[INT:i.*]] @test2() {
+// CHECK: define weak [[INT:i.*]] @test2() [[TF]] {
// CHECK-NOEXC: define weak [[INT:i.*]] @test2() [[NUW]] {
__attribute__((weak)) int test2(void) {
return 0;
}
+// CHECK: attributes [[TF]] = { "{{.*}} }
// CHECK: attributes [[NUW]] = { nounwind{{.*}} }
// CHECK-NOEXC: attributes [[NUW]] = { nounwind{{.*}} }