3 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
5 # RUN: echo "ENTRY(_label)" > %t.script
6 # RUN: ld.lld -o %t2 %t.script %t
7 # RUN: llvm-readobj %t2 > /dev/null
9 # The entry symbol should not cause an undefined error.
10 # RUN: echo "ENTRY(_wrong_label)" > %t.script
11 # RUN: ld.lld -o %t2 %t.script %t
12 # RUN: ld.lld --entry=abc -o %t2 %t
14 # -e has precedence over linker script's ENTRY.
15 # RUN: echo "ENTRY(_label)" > %t.script
16 # RUN: ld.lld -e _start -o %t2 %t.script %t
17 # RUN: llvm-readobj -file-headers -symbols %t2 | \
18 # RUN: FileCheck -check-prefix=OVERLOAD %s
20 # OVERLOAD: Entry: [[ENTRY:0x[0-9A-F]+]]
21 # OVERLOAD: Name: _start
22 # OVERLOAD-NEXT: Value: [[ENTRY]]
24 # The entry symbol can be a linker-script-defined symbol.
25 # RUN: echo "ENTRY(foo); foo = 1;" > %t.script
26 # RUN: ld.lld -o %t2 %t.script %t
27 # RUN: llvm-readobj -file-headers -symbols %t2 | \
28 # RUN: FileCheck -check-prefix=SCRIPT %s
32 # RUN: echo "ENTRY(no_such_symbol);" > %t.script
33 # RUN: ld.lld -o %t2 %t.script %t 2>&1 | \
34 # RUN: FileCheck -check-prefix=MISSING %s
36 # MISSING: warning: cannot find entry symbol no_such_symbol