1$ cat private_extern.c
2__attribute__((visibility("hidden")))
3int* foo() {
4  int i = 10;
5  volatile int* j = &i;
6  return j;
7}
8
9int* bar() {
10  return foo();
11}
12
13$ cat extern.c
14__attribute__((visibility("hidden")))
15int* foo() {
16  int i = 10;
17  volatile int* j = &i;
18  return j;
19}
20
21int* bar() {
22  return foo();
23}
24
25$ cat main.c
26int* bar();
27int main() {
28  return *bar();
29}
30
31$ cat alias_list
32_foo _baz
33
34$ xcrun --sdk iphoneos clang -g private_extern.c -c -o private_extern.o -target arm64-apple-ios14.0
35$ xcrun --sdk iphoneos clang -g main.c -c -o main.o -target arm64-apple-ios14.0
36$ xcrun --sdk iphoneos clang private_extern.o main.o -target arm64-apple-ios14.0 -o private_extern.out -Xlinker -alias_list -Xlinker alias_list
37
38RUN: dsymutil -oso-prepend-path %p/../Inputs %p/../Inputs/private/tmp/private_extern/private_extern.out -o %t.dSYM --verbose 2>&1 | FileCheck %s
39RUN: dsymutil -oso-prepend-path %p/../Inputs %p/../Inputs/private/tmp/extern/extern.out -o %t.dSYM --verbose 2>&1 | FileCheck %s
40CHECK-NOT: could not find object file symbol for symbol _baz
41CHECK: { sym: _foo, objAddr: 0x0, binAddr: 0x100007F58, size: 0x20 }
42CHECK: { sym: _baz, objAddr: 0x0, binAddr: 0x100007F58, size: 0x0 }
43