• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# REQUIRES: x86
2# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t1
3
4# RUN: ld.lld -e foobar %t1 -o %t2 2>&1 | FileCheck -check-prefix=WARN1 %s
5# RUN: llvm-readobj --file-headers %t2 | FileCheck -check-prefix=TEXT %s
6
7# WARN1: warning: cannot find entry symbol foobar; defaulting to 0x201120
8# TEXT: Entry: 0x201120
9
10# RUN: ld.lld %t1 -o %t2 2>&1 | FileCheck -check-prefix=WARN2 %s
11# WARN2: warning: cannot find entry symbol _start; defaulting to 0x201120
12
13# RUN: ld.lld -shared -e foobar %t1 -o %t2 2>&1 | FileCheck -check-prefix=WARN3 %s
14# WARN3: warning: cannot find entry symbol foobar; defaulting to 0x1238
15
16# RUN: ld.lld -shared --fatal-warnings -e entry %t1 -o %t2
17# RUN: ld.lld -shared --fatal-warnings %t1 -o %t2
18
19# RUN: echo .data > %t.s
20# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux -n %t.s -o %t3
21# RUN: ld.lld %t3 -o %t4 2>&1 | FileCheck -check-prefix=WARN4 %s
22# RUN: llvm-readobj --file-headers %t4 | FileCheck -check-prefix=NOENTRY %s
23
24# WARN4: cannot find entry symbol _start; not setting start address
25# NOENTRY: Entry: 0x0
26
27# RUN: ld.lld -v -r %t1 -o %t2 2>&1 | FileCheck -check-prefix=WARN5 %s
28# WARN5-NOT: warning: cannot find entry symbol
29
30# RUN: ld.lld %t1 -o %t2 -e entry
31# RUN: llvm-readobj --file-headers %t2 | FileCheck -check-prefix=SYM %s
32# SYM: Entry: 0x201128
33
34# RUN: ld.lld %t1 --fatal-warnings -shared -o %t2 -e entry
35# RUN: llvm-readobj --file-headers %t2 | FileCheck -check-prefix=DSO %s
36# DSO: Entry: 0x1240
37
38# RUN: ld.lld %t1 -o %t2 --entry=4096
39# RUN: llvm-readobj --file-headers %t2 | FileCheck -check-prefix=DEC %s
40# DEC: Entry: 0x1000
41
42# RUN: ld.lld %t1 -o %t2 --entry 0xcafe
43# RUN: llvm-readobj --file-headers %t2 | FileCheck -check-prefix=HEX %s
44# HEX: Entry: 0xCAFE
45
46# RUN: ld.lld %t1 -o %t2 -e 0777
47# RUN: llvm-readobj --file-headers %t2 | FileCheck -check-prefix=OCT %s
48# OCT: Entry: 0x1FF
49
50.globl entry
51.text
52	.quad 0
53entry:
54	ret
55