3 # RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o
5 # RUN: ld.lld %t.o -o %t
6 # RUN: llvm-readelf -s %t | FileCheck %s
8 # CHECK: 0 NOTYPE GLOBAL PROTECTED 2 __start_aaa
9 # CHECK: 0 NOTYPE GLOBAL PROTECTED 2 __stop_aaa
11 # RUN: ld.lld -z start-stop-visibility=default %t.o -o %t1
12 # RUN: llvm-readelf -s %t1 | FileCheck --check-prefix=CHECK-DEFAULT %s
14 # CHECK-DEFAULT: 0 NOTYPE GLOBAL DEFAULT 2 __start_aaa
15 # CHECK-DEFAULT: 0 NOTYPE GLOBAL DEFAULT 2 __stop_aaa
17 # RUN: ld.lld -z start-stop-visibility=internal %t.o -o %t2
18 # RUN: llvm-readelf -s %t2 | FileCheck --check-prefix=CHECK-INTERNAL %s
20 # CHECK-INTERNAL: 0 NOTYPE LOCAL INTERNAL 2 __start_aaa
21 # CHECK-INTERNAL: 0 NOTYPE LOCAL INTERNAL 2 __stop_aaa
23 # RUN: ld.lld -z start-stop-visibility=hidden %t.o -o %t3
24 # RUN: llvm-readelf -s %t3 | FileCheck --check-prefix=CHECK-HIDDEN %s
26 # CHECK-HIDDEN: 0 NOTYPE LOCAL HIDDEN 2 __start_aaa
27 # CHECK-HIDDEN: 0 NOTYPE LOCAL HIDDEN 2 __stop_aaa
29 # RUN: ld.lld -z start-stop-visibility=protected %t.o -o %t4
30 # RUN: llvm-readelf -s %t4 | FileCheck --check-prefix=CHECK-PROTECTED %s
32 # CHECK-PROTECTED: 0 NOTYPE GLOBAL PROTECTED 2 __start_aaa
33 # CHECK-PROTECTED: 0 NOTYPE GLOBAL PROTECTED 2 __stop_aaa
35 # RUN: not ld.lld -z start-stop-visibility=aaa %t.o -o /dev/null
36 # CHECK-ERROR: error: unknown -z start-stop-visibility= value: aaa