3 # RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o
5 # RUN: echo "ENTRY(_label)" > %t.script
6 # RUN: ld.lld %t.script %t.o -o %t
7 # RUN: llvm-readelf -hs %t | FileCheck %s
9 # RUN: echo 'ENTRY("_label")' > %t.script
10 # RUN: ld.lld %t.script %t.o -o %t
11 # RUN: llvm-readelf -hs %t | FileCheck %s
13 # CHECK: Entry point address: 0x[[#%x,ENTRY:]]
14 # CHECK: [[#]]: {{0*}}[[#ENTRY]] 0 NOTYPE GLOBAL DEFAULT [[#]] _label
16 ## -e overrides the ENTRY command.
17 # RUN: echo "ENTRY(_label)" > %t.script
18 # RUN: ld.lld -e _start -o %t2 %t.script %t.o
19 # RUN: llvm-readobj --file-headers --symbols %t2 | \
20 # RUN: FileCheck -check-prefix=OVERLOAD %s
22 # OVERLOAD: Entry: [[ENTRY:0x[0-9A-F]+]]
23 # OVERLOAD: Name: _start
24 # OVERLOAD-NEXT: Value: [[ENTRY]]
26 ## The entry symbol can be a linker-script-defined symbol.
27 # RUN: echo "ENTRY(foo); foo = 1;" > %t.script
28 # RUN: ld.lld -o %t %t.script %t.o
29 # RUN: llvm-readobj --file-headers --symbols %t | FileCheck --check-prefix=SCRIPT %s
33 ## An undefined entry symbol causes a warning.
34 # RUN: echo "ENTRY(no_such_symbol);" > %t.script
35 # RUN: ld.lld %t.script %t.o -o /dev/null 2>&1 | FileCheck --check-prefix=MISSING %s
37 # MISSING: warning: cannot find entry symbol no_such_symbol