Add more of the command line options as attribute flags.

These can be easily queried by the back-end.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176304 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/CodeGen/2008-04-08-NoExceptions.c b/test/CodeGen/2008-04-08-NoExceptions.c
index 254d30a..1213492 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 29ba5a8..88f75a1 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 @@
 // 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 8ad00fa..25ca916 100644
--- a/test/CodeGen/function-attributes.c
+++ b/test/CodeGen/function-attributes.c
@@ -43,7 +43,7 @@
 
 // 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 @@
 
 // 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 2dec3c4..fe5d810 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 @@
 // 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 1a7d3cd..e505a6e 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 @@
 }
 
 // <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{{.*}} }