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
// 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;
namespace test27 {
template<typename T>
class C {
- class __attribute__((visibility("default"))) D {
+ class DEFAULT D {
void f();
};
};
namespace test21 {
enum En { en };
template<En> struct A {
- __attribute__((visibility("default"))) void foo() {}
+ DEFAULT void foo() {}
};
// CHECK: define weak_odr void @_ZN6test211AILNS_2EnE0EE3fooEv(
namespace test26 {
template<typename T>
class C {
- __attribute__((visibility("default"))) void f();
+ DEFAULT void f();
};
template<>
namespace {
struct zed;
}
- template __attribute__((visibility("default"))) void foo::bar<zed>();
+ template DEFAULT void foo::bar<zed>();
void baz() {
foo::bar<zed>();
}
namespace test55 {
template <class T>
- struct __attribute__((visibility("hidden"))) foo {
+ struct HIDDEN foo {
static void bar();
};
template <class T> struct foo;
namespace test56 {
template <class T> struct foo;
template <class T>
- struct __attribute__((visibility("hidden"))) foo {
+ struct HIDDEN foo {
static void bar();
};
void foobar() {
#pragma GCC visibility push(hidden)
struct foo;
template<typename T>
- struct __attribute__((visibility("default"))) bar {
+ struct DEFAULT bar {
static void zed() {
}
};
namespace test60 {
template<int i>
- class __attribute__((visibility("hidden"))) a {};
+ class HIDDEN a {};
template<int i>
- class __attribute__((visibility("default"))) b {};
+ class DEFAULT b {};
template<template<int> class x, template<int> class y>
void test() {}
void use() {
// 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<int>;
+ template class HIDDEN Class1<int>;
}
namespace test62 {
}
}
namespace test62 {
- template class __attribute__ ((visibility("hidden"))) Class1<int>;
+ template class HIDDEN Class1<int>;
// 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.
namespace test66 {
template <typename T>
- struct __attribute__((visibility("default"))) barT {
+ struct DEFAULT barT {
static void zed() {}
};
class foo;
- class __attribute__((visibility("default"))) foo;
+ class DEFAULT foo;
template struct barT<foo>;
// CHECK: define weak_odr void @_ZN6test664barTINS_3fooEE3zedEv
// CHECK-HIDDEN: define weak_odr void @_ZN6test664barTINS_3fooEE3zedEv
template <int* I>
- 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<fType F>
- struct __attribute__((visibility("default"))) barF {
+ struct DEFAULT barF {
static void zed() {}
};
void F();
- void F() __attribute__((visibility("default")));;
+ void F() DEFAULT;
template struct barF<F>;
// CHECK: define weak_odr void @_ZN6test664barFIXadL_ZNS_1FEvEEE3zedEv
// CHECK-HIDDEN: define weak_odr void @_ZN6test664barFIXadL_ZNS_1FEvEEE3zedEv