1# REQUIRES: x86 2 3# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o 4 5# RUN: ld.lld %t.o -o %t 6# RUN: llvm-readelf -s %t | FileCheck %s 7 8# CHECK: 0 NOTYPE GLOBAL PROTECTED 2 __start_aaa 9# CHECK: 0 NOTYPE GLOBAL PROTECTED 2 __stop_aaa 10 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 13 14# CHECK-DEFAULT: 0 NOTYPE GLOBAL DEFAULT 2 __start_aaa 15# CHECK-DEFAULT: 0 NOTYPE GLOBAL DEFAULT 2 __stop_aaa 16 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 19 20# CHECK-INTERNAL: 0 NOTYPE LOCAL INTERNAL 2 __start_aaa 21# CHECK-INTERNAL: 0 NOTYPE LOCAL INTERNAL 2 __stop_aaa 22 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 25 26# CHECK-HIDDEN: 0 NOTYPE LOCAL HIDDEN 2 __start_aaa 27# CHECK-HIDDEN: 0 NOTYPE LOCAL HIDDEN 2 __stop_aaa 28 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 31 32# CHECK-PROTECTED: 0 NOTYPE GLOBAL PROTECTED 2 __start_aaa 33# CHECK-PROTECTED: 0 NOTYPE GLOBAL PROTECTED 2 __stop_aaa 34 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 37 38.quad __start_aaa 39.quad __stop_aaa 40.section aaa,"ax" 41 42.global _start 43.text 44_start: 45 nop 46