1 /* PR c++/30066: Test that -fvisibility-inlines-hidden affects functions. */
2 /* { dg-do compile } */
3 /* { dg-require-visibility "" } */
4 /* { dg-options "-fvisibility-inlines-hidden" } */
5 /* { dg-final { scan-hidden "_Z3barv" } } */
6 /* { dg-final { scan-not-hidden "_ZZ3barvE1n" } } */
7 /* { dg-final { scan-not-hidden "_Z3fooIiEvv" } } */
8 /* { dg-final { scan-hidden "_Z3fooIvEvv" } } */
9 /* { dg-final { scan-hidden "_ZZN1A5innerEvE1n" } } */
10
bar()11 inline int * bar()
12 {
13 static int n;
14 return &n;
15 }
16
17 template <class T>
foo()18 inline void foo() { }
19
20 template void foo<int>();
21
22 namespace A __attribute__ ((visibility ("hidden")))
23 {
inner()24 inline int * inner()
25 {
26 static int n;
27 return &n;
28 }
29 }
30
main(void)31 int main(void)
32 {
33 bar();
34 foo<void>();
35 A::inner();
36 return 0;
37 }
38