xref: /llvm-project/llvm/test/tools/dsymutil/Inputs/accel-imported-declaration.cpp (revision b8ef007fca1d959947d65853f56e407560d7699d)
1*b8ef007fSMichael Buch // Compiled on macOS using:
2*b8ef007fSMichael Buch // 1. clang++ -c -std=c++2a -gdwarf-4 -O0 -o accel-imported-declaration.macho-arm64.o
3*b8ef007fSMichael Buch // 2. clang++ -Wl,-oso_prefix=$PWD accel-imported-declaration.macho-arm64.o -o accel-imported-declaration.macho-arm64
4*b8ef007fSMichael Buch //
5*b8ef007fSMichael Buch // In step 2 it's important to strip the absolute object file paths
6*b8ef007fSMichael Buch //
7*b8ef007fSMichael Buch // Verify that the OSO path isn't absolute using `nm -ap accel-imported-declaration.macho-arm64`
8*b8ef007fSMichael Buch 
9*b8ef007fSMichael Buch namespace A {
10*b8ef007fSMichael Buch namespace B {
11*b8ef007fSMichael Buch namespace C {
12*b8ef007fSMichael Buch int a = -1;
13*b8ef007fSMichael Buch } // namespace C
14*b8ef007fSMichael Buch } // namespace B
15*b8ef007fSMichael Buch 
16*b8ef007fSMichael Buch namespace C = B::C;
17*b8ef007fSMichael Buch 
18*b8ef007fSMichael Buch using namespace B::C;
19*b8ef007fSMichael Buch using B::C::a;
20*b8ef007fSMichael Buch } // namespace A
21*b8ef007fSMichael Buch 
main()22*b8ef007fSMichael Buch int main() { return A::a; }
23