From: Rafael Espindola Date: Tue, 26 Feb 2013 23:24:59 +0000 (+0000) Subject: Use existing macros to simplify the test a bit. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b58f810669d9c17bcc025b7560de01d162856f34;p=clang Use existing macros to simplify the test a bit. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176138 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/CodeGenCXX/visibility.cpp b/test/CodeGenCXX/visibility.cpp index 5511da7cb3..537e89dc1b 100644 --- a/test/CodeGenCXX/visibility.cpp +++ b/test/CodeGenCXX/visibility.cpp @@ -47,7 +47,7 @@ namespace test29 { struct RECT { int top; }; - __attribute__ ((visibility ("default"))) extern RECT data_rect; + DEFAULT extern RECT data_rect; RECT data_rect = { -1}; #pragma GCC visibility pop // CHECK: @_ZN6test299data_rectE = global @@ -70,7 +70,7 @@ namespace test41 { // Unlike gcc we propagate the information that foo not only is hidden, but // has been explicitly marked as so. This lets us produce a hidden undefined // reference to bar. - struct __attribute__((visibility("hidden"))) foo {}; + struct HIDDEN foo {}; extern foo bar; foo *zed() { return &bar; @@ -119,7 +119,7 @@ namespace test48 { namespace test27 { template class C { - class __attribute__((visibility("default"))) D { + class DEFAULT D { void f(); }; }; @@ -526,7 +526,7 @@ namespace Test20 { namespace test21 { enum En { en }; template struct A { - __attribute__((visibility("default"))) void foo() {} + DEFAULT void foo() {} }; // CHECK: define weak_odr void @_ZN6test211AILNS_2EnE0EE3fooEv( @@ -666,7 +666,7 @@ namespace test24 { namespace test26 { template class C { - __attribute__((visibility("default"))) void f(); + DEFAULT void f(); }; template<> @@ -889,7 +889,7 @@ namespace test47 { namespace { struct zed; } - template __attribute__((visibility("default"))) void foo::bar(); + template DEFAULT void foo::bar(); void baz() { foo::bar(); } @@ -1017,7 +1017,7 @@ namespace test54 { namespace test55 { template - struct __attribute__((visibility("hidden"))) foo { + struct HIDDEN foo { static void bar(); }; template struct foo; @@ -1031,7 +1031,7 @@ namespace test55 { namespace test56 { template struct foo; template - struct __attribute__((visibility("hidden"))) foo { + struct HIDDEN foo { static void bar(); }; void foobar() { @@ -1062,7 +1062,7 @@ namespace test58 { #pragma GCC visibility push(hidden) struct foo; template - struct __attribute__((visibility("default"))) bar { + struct DEFAULT bar { static void zed() { } }; @@ -1093,9 +1093,9 @@ namespace test59 { namespace test60 { template - class __attribute__((visibility("hidden"))) a {}; + class HIDDEN a {}; template - class __attribute__((visibility("default"))) b {}; + class DEFAULT b {}; template class x, template class y> void test() {} void use() { @@ -1128,7 +1128,7 @@ namespace test61 { // Just test that we don't crash. Currently we apply this attribute. Current // gcc issues a warning about it being unused since "the type is already // defined". We should probably do the same. - template class __attribute__ ((visibility("hidden"))) Class1; + template class HIDDEN Class1; } namespace test62 { @@ -1147,7 +1147,7 @@ namespace test62 { } } namespace test62 { - template class __attribute__ ((visibility("hidden"))) Class1; + template class HIDDEN Class1; // Just test that we don't crash. Currently we apply this attribute. Current // gcc issues a warning about it being unused since "the type is already // defined". We should probably do the same. @@ -1230,32 +1230,32 @@ namespace test65 { namespace test66 { template - struct __attribute__((visibility("default"))) barT { + struct DEFAULT barT { static void zed() {} }; class foo; - class __attribute__((visibility("default"))) foo; + class DEFAULT foo; template struct barT; // CHECK: define weak_odr void @_ZN6test664barTINS_3fooEE3zedEv // CHECK-HIDDEN: define weak_odr void @_ZN6test664barTINS_3fooEE3zedEv template - struct __attribute__((visibility("default"))) barI { + struct DEFAULT barI { static void zed() {} }; extern int I; - extern int I __attribute__((visibility("default"))); + extern int I DEFAULT; template struct barI<&I>; // CHECK: define weak_odr void @_ZN6test664barIIXadL_ZNS_1IEEEE3zedEv // CHECK-HIDDEN: define weak_odr void @_ZN6test664barIIXadL_ZNS_1IEEEE3zedEv typedef void (*fType)(void); template - struct __attribute__((visibility("default"))) barF { + struct DEFAULT barF { static void zed() {} }; void F(); - void F() __attribute__((visibility("default")));; + void F() DEFAULT; template struct barF; // CHECK: define weak_odr void @_ZN6test664barFIXadL_ZNS_1FEvEEE3zedEv // CHECK-HIDDEN: define weak_odr void @_ZN6test664barFIXadL_ZNS_1FEvEEE3zedEv