Add dg-require-visibility to tests that require visibility support.
[official-gcc.git] / gcc / testsuite / g++.dg / ext / visibility / ref-temp1.C
blob5d3e99ddb76f4e5a443c50fc60a7c3cc06697afa
1 // PR c++/91476
2 // Test that hidden and internal visibility propagates to reference temps.
3 // { dg-require-visibility "" }
5 #define HIDDEN __attribute((visibility("hidden")))
7 // { dg-final { scan-hidden "_ZGRZ1fvE3foo_" } }
8 HIDDEN inline const int* f() { static const int &foo = 1; return &foo; }
10 // { dg-final { scan-assembler-not "(weak|globl)\[^\n\]*_ZGRN12_GLOBAL__N_13fooE_" } }
11 namespace { const int &foo = 1; }
13 const void *volatile p;
14 int main()
16   p = f();
17   p = &foo;