2 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o
4 # RUN: %lld %t.o -lSystem -o %t.out
5 # RUN: llvm-readobj --syms %t.out | FileCheck %s
7 ## ld64 has a "TEMP work around until <rdar://problem/7702923> goes in"
8 ## that promotes PrivateExtern ReferencedDynamically symbols in dylibs to
9 ## normal Externs. lld does not do this.
10 # RUN: %lld -dylib %t.o -o %t.dylib
11 # RUN: llvm-readobj --syms %t.dylib | FileCheck %s
13 # CHECK: Name: ___crashreporter_info__
14 # CHECK-NEXT: PrivateExtern
15 # CHECK-NEXT: Type: Section (0xE)
16 # CHECK-NEXT: Section: __common
17 # CHECK-NEXT: RefType: UndefinedNonLazy (0x0)
18 # CHECK-NEXT: Flags [ (0x10)
19 # CHECK-NEXT: ReferencedDynamically (0x10)
22 ## Reduced from lib/Support/PrettyStackTrace.cpp
23 .section __TEXT,__text,regular,pure_instructions
29 ## .private_extern matches what PrettyStackTrace.cpp does, but it makes
30 ## the ReferencedDynamically pointless: https://reviews.llvm.org/D27683#2763729
31 .private_extern ___crashreporter_info__
32 .globl ___crashreporter_info__
33 .desc ___crashreporter_info__,16
34 .zerofill __DATA,__common,___crashreporter_info__,8,3
35 .subsections_via_symbols