aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-02-20 19:30:01 +0000
committerBill Wendling <isanbard@gmail.com>2013-02-20 19:30:01 +0000
commit3bba3efba0e57071d60b355ed62639f93e37711c (patch)
tree9eb792a303ca5ad3cd2a3ea0c307a876864b5bb1
parent6b3d3e54c003b03f16e235ad2ff49e95587bbf92 (diff)
Attempt to clean up tests for non-X86 platforms.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175652 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/CXX/special/class.dtor/p3-0x.cpp9
-rw-r--r--test/CodeGen/address-safety-attr.cpp43
-rw-r--r--test/CodeGen/attr-coldhot.c4
-rw-r--r--test/CodeGen/attr-minsize.cpp41
-rw-r--r--test/CodeGen/code-coverage.c11
-rw-r--r--test/CodeGen/stack-protector.c12
-rw-r--r--test/CodeGenCXX/cxx11-noreturn.cpp6
-rw-r--r--test/CodeGenCXX/noinline-template.cpp5
-rw-r--r--test/CodeGenObjCXX/address-safety-attr.mm12
9 files changed, 67 insertions, 76 deletions
diff --git a/test/CXX/special/class.dtor/p3-0x.cpp b/test/CXX/special/class.dtor/p3-0x.cpp
index a3d890be3f..c3d3f6ab36 100644
--- a/test/CXX/special/class.dtor/p3-0x.cpp
+++ b/test/CXX/special/class.dtor/p3-0x.cpp
@@ -164,11 +164,11 @@ void tsw() {
Sw<int> swi;
Sw<B> swb;
}
-// CHECK-NOT: define linkonce_odr {{.*}} @_ZN2SwI1BED1Ev({{.*}} #2
+// CHECK-NOT: define linkonce_odr {{.*}} @_ZN2SwI1BED1Ev({{.*}} #
// CHECK: define linkonce_odr {{.*}} @_ZN2SwI1BED1Ev({{.*}}
// CHECK: _ZTIi
// CHECK: __cxa_call_unexpected
-// CHECK: define linkonce_odr {{.*}} @_ZN2SwIiED1Ev({{.*}} #2
+// CHECK: define linkonce_odr {{.*}} @_ZN2SwIiED1Ev({{.*}} [[ATTRGRP:#[0-9]+]]
template <typename T>
struct TVC : VX
@@ -176,7 +176,4 @@ struct TVC : VX
template <typename T>
TVC<T>::~TVC() {}
-// CHECK: attributes #0 = { "target-features"={{.*}} }
-// CHECK: attributes #1 = { noinline noreturn nounwind }
-// CHECK: attributes #2 = { nounwind "target-features"={{.*}} }
-// CHECK: attributes #3 = { inlinehint nounwind "target-features"={{.*}} }
+// CHECK: attributes [[ATTRGRP]] = { nounwind "target-features"={{.*}} }
diff --git a/test/CodeGen/address-safety-attr.cpp b/test/CodeGen/address-safety-attr.cpp
index aedbbc2bcb..827f8d15b4 100644
--- a/test/CodeGen/address-safety-attr.cpp
+++ b/test/CodeGen/address-safety-attr.cpp
@@ -1,7 +1,7 @@
-// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s
-// RUN: %clang_cc1 -emit-llvm -o - %s -fsanitize=address | FileCheck -check-prefix ASAN %s
+// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck -check-prefix=WITHOUT %s
+// RUN: %clang_cc1 -emit-llvm -o - %s -fsanitize=address | FileCheck -check-prefix=ASAN %s
// RUN: echo "src:%s" > %t
-// RUN: %clang_cc1 -emit-llvm -o - %s -fsanitize=address -fsanitize-blacklist=%t | FileCheck %s
+// RUN: %clang_cc1 -emit-llvm -o - %s -fsanitize=address -fsanitize-blacklist=%t | FileCheck -check-prefix=BL %s
// FIXME: %t is like "src:x:\path\to\clang\test\CodeGen\address-safety-attr.cpp"
// REQUIRES: shell
@@ -10,28 +10,33 @@
// when AddressSanitizer is enabled, unless no_address_safety_analysis attribute
// is present.
-// CHECK: NoAddressSafety1{{.*}}#0
-// ASAN: NoAddressSafety1{{.*}}#0
+// WITHOUT: NoAddressSafety1{{.*}}) #[[NOATTR:[0-9]+]]
+// BL: NoAddressSafety1{{.*}}) #[[NOATTR:[0-9]+]]
+// ASAN: NoAddressSafety1{{.*}}) #[[NOATTR:[0-9]+]]
__attribute__((no_address_safety_analysis))
int NoAddressSafety1(int *a) { return *a; }
-// CHECK: NoAddressSafety2{{.*}}#0
-// ASAN: NoAddressSafety2{{.*}}#0
+// WITHOUT: NoAddressSafety2{{.*}}) #[[NOATTR]]
+// BL: NoAddressSafety2{{.*}}) #[[NOATTR]]
+// ASAN: NoAddressSafety2{{.*}}) #[[NOATTR]]
__attribute__((no_address_safety_analysis))
int NoAddressSafety2(int *a);
int NoAddressSafety2(int *a) { return *a; }
-// CHECK: AddressSafetyOk{{.*}}#0
-// ASAN: AddressSafetyOk{{.*}}#1
+// WITHOUT: AddressSafetyOk{{.*}}) #[[NOATTR]]
+// BL: AddressSafetyOk{{.*}}) #[[NOATTR]]
+// ASAN: AddressSafetyOk{{.*}}) #[[WITH:[0-9]+]]
int AddressSafetyOk(int *a) { return *a; }
-// CHECK: TemplateAddressSafetyOk{{.*}}#0
-// ASAN: TemplateAddressSafetyOk{{.*}}#1
+// WITHOUT: TemplateAddressSafetyOk{{.*}}) #[[NOATTR]]
+// BL: TemplateAddressSafetyOk{{.*}}) #[[NOATTR]]
+// ASAN: TemplateAddressSafetyOk{{.*}}) #[[WITH]]
template<int i>
int TemplateAddressSafetyOk() { return i; }
-// CHECK: TemplateNoAddressSafety{{.*}}#0
-// ASAN: TemplateNoAddressSafety{{.*}}#0
+// WITHOUT: TemplateNoAddressSafety{{.*}}) #[[NOATTR]]
+// BL: TemplateNoAddressSafety{{.*}}) #[[NOATTR]]
+// ASAN: TemplateNoAddressSafety{{.*}}) #[[NOATTR]]
template<int i>
__attribute__((no_address_safety_analysis))
int TemplateNoAddressSafety() { return i; }
@@ -42,12 +47,12 @@ int force_instance = TemplateAddressSafetyOk<42>()
// Check that __cxx_global_var_init* get the address_safety attribute.
int global1 = 0;
int global2 = *(int*)((char*)&global1+1);
-// CHECK: @__cxx_global_var_init{{.*}}#1
+// WITHOUT: @__cxx_global_var_init{{.*}}#1
+// BL: @__cxx_global_var_init{{.*}}#1
// ASAN: @__cxx_global_var_init{{.*}}#2
-// CHECK: attributes #0 = { nounwind "target-features"={{.*}} }
-// CHECK: attributes #1 = { nounwind }
+// WITHOUT: attributes #[[NOATTR]] = { nounwind "target-features"={{.*}} }
+// BL: attributes #[[NOATTR]] = { nounwind "target-features"={{.*}} }
-// ASAN: attributes #0 = { nounwind "target-features"={{.*}} }
-// ASAN: attributes #1 = { address_safety nounwind "target-features"={{.*}} }
-// ASAN: attributes #2 = { address_safety nounwind }
+// ASAN: attributes #[[NOATTR]] = { nounwind "target-features"={{.*}} }
+// ASAN: attributes #[[WITH]] = { address_safety nounwind "target-features"={{.*}} }
diff --git a/test/CodeGen/attr-coldhot.c b/test/CodeGen/attr-coldhot.c
index f553b136eb..a277119708 100644
--- a/test/CodeGen/attr-coldhot.c
+++ b/test/CodeGen/attr-coldhot.c
@@ -4,8 +4,8 @@ int test1() __attribute__((__cold__)) {
return 42;
// Check that we set the optsize attribute on the function.
-// CHECK: @test1{{.*}}#0
+// CHECK: @test1{{.*}}[[ATTR:#[0-9]+]]
// CHECK: ret
}
-// CHECK: attributes #0 = { nounwind optsize "target-features"={{.*}} }
+// CHECK: attributes [[ATTR]] = { {{.*}}optsize{{.*}} }
diff --git a/test/CodeGen/attr-minsize.cpp b/test/CodeGen/attr-minsize.cpp
index 5611916f59..997194df7f 100644
--- a/test/CodeGen/attr-minsize.cpp
+++ b/test/CodeGen/attr-minsize.cpp
@@ -7,29 +7,29 @@
// Check that we set the minsize attribute on each function
// when Oz optimization level is set.
+__attribute__((minsize))
int test1() {
return 42;
-// Oz: @{{.*}}test1{{.*}}#0
-// Oz: ret
-// OTHER: @{{.*}}test1
-// OTHER-NOT: #1
-// OTHER: ret
+// Oz: @{{.*}}test1{{.*}}[[MINSIZE:#[0-9]+]]
+// OTHER: @{{.*}}test1{{.*}}[[MS:#[0-9]+]]
}
int test2() {
return 42;
-// Oz: @{{.*}}test2{{.*}}#0
+// Oz: @{{.*}}test2{{.*}}[[MINSIZE]]
// Oz: ret
// OTHER: @{{.*}}test2
-// OTHER-NOT: #1
+// OTHER-NOT: [[MS]]
// OTHER: ret
}
-__attribute__((minsize))
int test3() {
return 42;
-// Oz: @{{.*}}test3{{.*}}#0
-// OTHER: @{{.*}}test3{{.*}}#1
+// Oz: @{{.*}}test3{{.*}}[[MINSIZE]]
+// Oz: ret
+// OTHER: @{{.*}}test3
+// OTHER-NOT: [[MS]]
+// OTHER: ret
}
// 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: #0
+// Oz: [[MINSIZE]]
// OTHER: define{{.*}}void @{{.*}}test4
-// OTHER: #1
+// OTHER: [[MS]]
template
void test4<float>(float arg);
// Oz: define{{.*}}void @{{.*}}test4
-// Oz: #0
+// Oz: [[MINSIZE]]
// OTHER: define{{.*}}void @{{.*}}test4
-// OTHER: #1
+// OTHER: [[MS]]
template<typename T>
void test5(T arg) {
@@ -63,18 +63,17 @@ void test5(T arg) {
template
void test5<int>(int arg);
// Oz: define{{.*}}void @{{.*}}test5
-// Oz: #0
+// Oz: [[MINSIZE]]
// OTHER: define{{.*}}void @{{.*}}test5
-// OTHER-NOT: define{{.*}}void @{{.*}}test5{{.*}}#1
+// OTHER-NOT: define{{.*}}void @{{.*}}test5{{.*}}[[MS]]
template
void test5<float>(float arg);
// Oz: define{{.*}}void @{{.*}}test5
-// Oz: #0
+// Oz: [[MINSIZE]]
// OTHER: define{{.*}}void @{{.*}}test5
-// OTHER-NOT: define{{.*}}void @{{.*}}test5{{.*}}#1
+// OTHER-NOT: define{{.*}}void @{{.*}}test5{{.*}}[[MS]]
-// Oz: attributes #0 = { minsize nounwind optsize readnone "target-features"={{.*}} }
+// Oz: attributes [[MINSIZE]] = { minsize{{.*}} }
-// OTHER: attributes #0 = { nounwind {{.*}}"target-features"={{.*}} }
-// OTHER: attributes #1 = { minsize nounwind {{.*}}"target-features"={{.*}} }
+// OTHER: attributes [[MS]] = { minsize nounwind{{.*}} }
diff --git a/test/CodeGen/code-coverage.c b/test/CodeGen/code-coverage.c
index 3c9392d1c5..f165e30e6f 100644
--- a/test/CodeGen/code-coverage.c
+++ b/test/CodeGen/code-coverage.c
@@ -14,10 +14,9 @@ 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 #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: void @__llvm_gcov_indirect_counter_increment(i32* %{{.*}}, i64** %{{.*}}) unnamed_addr [[NRZ:#[0-9]+]]
+// CHECK: void @__llvm_gcov_writeout() unnamed_addr [[NRZ]]
+// CHECK: void @__llvm_gcov_init() unnamed_addr [[NRZ]]
+// CHECK: void @__gcov_flush() unnamed_addr [[NRZ]]
-// CHECK: attributes #0 = { noredzone nounwind "target-features"={{.*}} }
-// CHECK: attributes #1 = { noinline noredzone }
+// CHECK: attributes [[NRZ]] = { {{.*}}noredzone{{.*}} }
diff --git a/test/CodeGen/stack-protector.c b/test/CodeGen/stack-protector.c
index b4e20cd15d..e47e5b321b 100644
--- a/test/CodeGen/stack-protector.c
+++ b/test/CodeGen/stack-protector.c
@@ -17,14 +17,8 @@ void test1(const char *msg) {
printf("%s\n", a);
}
-// NOSSP: attributes #0 = { nounwind "target-features"={{.*}} }
-// NOSSP: attributes #1 = { "target-features"={{.*}} }
-// NOSSP: attributes #2 = { nounwind }
+// NOSSP: attributes #{{.*}} = { nounwind{{.*}} }
-// WITHSSP: attributes #0 = { nounwind ssp "target-features"={{.*}} }
-// WITHSSP: attributes #1 = { "target-features"={{.*}} }
-// WITHSSP: attributes #2 = { nounwind }
+// WITHSSP: attributes #{{.*}} = { nounwind ssp{{.*}} }
-// SSPREQ: attributes #0 = { nounwind sspreq "target-features"={{.*}} }
-// SSPREQ: attributes #1 = { "target-features"={{.*}} }
-// SSPREQ: attributes #2 = { nounwind }
+// SSPREQ: attributes #{{.*}} = { nounwind sspreq{{.*}} }
diff --git a/test/CodeGenCXX/cxx11-noreturn.cpp b/test/CodeGenCXX/cxx11-noreturn.cpp
index fe67a298a4..31c651d75e 100644
--- a/test/CodeGenCXX/cxx11-noreturn.cpp
+++ b/test/CodeGenCXX/cxx11-noreturn.cpp
@@ -2,11 +2,9 @@
int g();
-// CHECK: _Z1fv(){{.*}} #0
+// CHECK: _Z1fv(){{.*}} [[NR:#[0-9]+]]
[[noreturn]] int f() {
while (g()) {}
}
-// CHECK: attributes #0 = { noreturn nounwind "target-features"={{.*}} }
-// CHECK: attributes #1 = { "target-features"={{.*}} }
-// CHECK: attributes #2 = { noreturn nounwind }
+// CHECK: attributes [[NR]] = { noreturn nounwind{{.*}} }
diff --git a/test/CodeGenCXX/noinline-template.cpp b/test/CodeGenCXX/noinline-template.cpp
index af88a849b1..51a84f74a6 100644
--- a/test/CodeGenCXX/noinline-template.cpp
+++ b/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) #1
+// CHECK: define linkonce_odr void @_ZN6VectorIiE13growStorageByEv(%struct.Vector* %this) [[NI:#[0-9]+]]
template <class Ty> struct Vector {
void growStorageBy();
@@ -15,5 +15,4 @@ void foo() {
strs.growStorageBy();
}
-// CHECK: attributes #0 = { nounwind "target-features"={{.*}} }
-// CHECK: attributes #1 = { noinline nounwind "target-features"={{.*}} }
+// CHECK: attributes [[NI]] = { noinline nounwind{{.*}} }
diff --git a/test/CodeGenObjCXX/address-safety-attr.mm b/test/CodeGenObjCXX/address-safety-attr.mm
index a2d9aa7cf3..cd9abaf110 100644
--- a/test/CodeGenObjCXX/address-safety-attr.mm
+++ b/test/CodeGenObjCXX/address-safety-attr.mm
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s
-// RUN: %clang_cc1 -emit-llvm -o - %s -fsanitize=address | FileCheck -check-prefix ASAN %s
+// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck -check-prefix=WITHOUT %s
+// RUN: %clang_cc1 -emit-llvm -o - %s -fsanitize=address | FileCheck -check-prefix=ASAN %s
@interface MyClass
+ (int) addressSafety:(int*)a;
@@ -7,15 +7,15 @@
@implementation MyClass
-// CHECK: +[MyClass load]{{.*}}#0
+// WITHOUT: +[MyClass load]{{.*}}#0
// ASAN: +[MyClass load]{{.*}}#0
+(void) load { }
-// CHECK: +[MyClass addressSafety:]{{.*}}#0
+// WITHOUT: +[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"={{.*}} }
+// WITHOUT: attributes #0 = { nounwind{{.*}} }
+// ASAN: attributes #0 = { address_safety nounwind{{.*}} }