1 // Contributed by Dodji Seketeli <dodji@redhat.com>
2 // Origin PR debug/39706
3 // { dg-options "-g -dA -fno-merge-debug-strings" }
6 // There should be one debug_pubnames section generated.
7 // On Darwin though, there is also a label pointing at the begining of the
8 // debug_pubnames section. The assembly code of that label adds an occurence
9 // of section declaration assembly. So on Darwin, we need to check for two
10 // occurences of the debug_pubnames section declaration.
11 // { dg-final { scan-assembler-times "\.section\[\t \].*?debug_pubnames" 1 { target { ! *-*-darwin* } } } }
12 // { dg-final { scan-assembler-times "\.section\[\t \].*?debug_pubnames" 2 { target { *-*-darwin* } } } }
14 // Then check of the presence of the names we are interested in.
15 // { dg-final { scan-assembler-times "\"main.0\".*external name" 1 } }
16 // { dg-final { scan-assembler-times "\"ns::ns_x.*external name" 1 } }
17 // { dg-final { scan-assembler-times "\"y::y_x.*external name" 1 } }
19 namespace ns { int ns_x; }
20 class y { public: static int y_x; };
22 int main() { return ns::ns_x; }