2014-11-12 Andreas Tobler <andreast@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / g++.dg / ext / visibility / arm3.C
blob52a935fc0ce44334c69d66d7ba2eb96817954812
1 // { dg-do compile { target arm_eabi } }
2 // { dg-require-dll "" }
3 // { dg-options "-fvisibility=hidden" }
5 /* From ARM C++ ABI \S 3.2.5.5:
7      A class should be exported unless explicitly tagged otherwise.
9    This admonition applies even on DLL-based systems where hidden
10    visibility is the default.  We want -fvisibility=hidden to behave
11    identically to the situation where hidden visibility is the
12    hard-wired default.  So, both A and B are exported classes.
14    Furthermore:
16      If CAG symbol Y names one of the impedimenta associated with an
17      exported class X:
19      ... 
21      * Otherwise, if X has no key function:
22      
23        - Y is exported from ... each DLL that refers to X and uses Y.
25    So, the type-info and virtual-table symbols associated with A and B
26    must be exported.  */
28 // { dg-final { scan-not-hidden "_ZTI1A" } }
29 // { dg-final { scan-not-hidden "_ZTS1A" } }
30 // { dg-final { scan-not-hidden "_ZTV1B" } }
31 // { dg-final { scan-not-hidden "_ZTI1B" } }
32 // { dg-final { scan-not-hidden "_ZTS1B" } }
34 struct A {};
35 struct B : virtual public A {};
36 B b;