2018-06-06 21:56:51 +08:00
|
|
|
# REQUIRES: x86
|
2015-09-30 00:40:13 +08:00
|
|
|
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t1
|
2016-09-27 03:04:42 +08:00
|
|
|
|
2016-11-24 06:41:00 +08:00
|
|
|
# RUN: ld.lld -e foobar %t1 -o %t2 2>&1 | FileCheck -check-prefix=WARN1 %s
|
2021-09-21 00:35:12 +08:00
|
|
|
# RUN: llvm-readobj --file-headers %t2 | FileCheck -check-prefix=NOENTRY %s
|
2016-11-24 06:41:00 +08:00
|
|
|
|
2021-09-21 00:35:12 +08:00
|
|
|
# WARN1: warning: cannot find entry symbol foobar; not setting start address
|
2016-11-24 06:41:00 +08:00
|
|
|
|
2016-10-20 04:05:43 +08:00
|
|
|
# RUN: ld.lld %t1 -o %t2 2>&1 | FileCheck -check-prefix=WARN2 %s
|
2021-09-21 00:35:12 +08:00
|
|
|
# RUN: llvm-readobj --file-headers %t2 | FileCheck -check-prefix=NOENTRY %s
|
|
|
|
# WARN2: warning: cannot find entry symbol _start; not setting start address
|
2016-11-24 06:41:00 +08:00
|
|
|
|
|
|
|
# RUN: ld.lld -shared -e foobar %t1 -o %t2 2>&1 | FileCheck -check-prefix=WARN3 %s
|
2021-09-21 00:35:12 +08:00
|
|
|
# RUN: llvm-readobj --file-headers %t2 | FileCheck -check-prefix=NOENTRY %s
|
|
|
|
# WARN3: warning: cannot find entry symbol foobar; not setting start address
|
2016-09-27 03:04:42 +08:00
|
|
|
|
|
|
|
# RUN: ld.lld -shared --fatal-warnings -e entry %t1 -o %t2
|
|
|
|
# RUN: ld.lld -shared --fatal-warnings %t1 -o %t2
|
|
|
|
|
2016-11-24 06:41:00 +08:00
|
|
|
# RUN: echo .data > %t.s
|
|
|
|
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux -n %t.s -o %t3
|
|
|
|
# RUN: ld.lld %t3 -o %t4 2>&1 | FileCheck -check-prefix=WARN4 %s
|
2019-05-01 13:49:01 +08:00
|
|
|
# RUN: llvm-readobj --file-headers %t4 | FileCheck -check-prefix=NOENTRY %s
|
2016-11-24 06:41:00 +08:00
|
|
|
|
|
|
|
# WARN4: cannot find entry symbol _start; not setting start address
|
|
|
|
# NOENTRY: Entry: 0x0
|
|
|
|
|
2016-12-21 06:24:45 +08:00
|
|
|
# RUN: ld.lld -v -r %t1 -o %t2 2>&1 | FileCheck -check-prefix=WARN5 %s
|
|
|
|
# WARN5-NOT: warning: cannot find entry symbol
|
|
|
|
|
2015-11-20 10:32:35 +08:00
|
|
|
# RUN: ld.lld %t1 -o %t2 -e entry
|
2019-05-01 13:49:01 +08:00
|
|
|
# RUN: llvm-readobj --file-headers %t2 | FileCheck -check-prefix=SYM %s
|
2019-09-16 15:05:34 +08:00
|
|
|
# SYM: Entry: 0x201128
|
2016-11-24 06:41:00 +08:00
|
|
|
|
2016-09-27 03:04:42 +08:00
|
|
|
# RUN: ld.lld %t1 --fatal-warnings -shared -o %t2 -e entry
|
2019-05-01 13:49:01 +08:00
|
|
|
# RUN: llvm-readobj --file-headers %t2 | FileCheck -check-prefix=DSO %s
|
2019-09-16 15:05:34 +08:00
|
|
|
# DSO: Entry: 0x1240
|
2016-11-24 06:41:00 +08:00
|
|
|
|
2016-07-05 05:50:50 +08:00
|
|
|
# RUN: ld.lld %t1 -o %t2 --entry=4096
|
2019-05-01 13:49:01 +08:00
|
|
|
# RUN: llvm-readobj --file-headers %t2 | FileCheck -check-prefix=DEC %s
|
2016-11-24 06:41:00 +08:00
|
|
|
# DEC: Entry: 0x1000
|
|
|
|
|
2016-07-05 05:50:50 +08:00
|
|
|
# RUN: ld.lld %t1 -o %t2 --entry 0xcafe
|
2019-05-01 13:49:01 +08:00
|
|
|
# RUN: llvm-readobj --file-headers %t2 | FileCheck -check-prefix=HEX %s
|
2016-11-24 06:41:00 +08:00
|
|
|
# HEX: Entry: 0xCAFE
|
|
|
|
|
2015-11-18 14:11:01 +08:00
|
|
|
# RUN: ld.lld %t1 -o %t2 -e 0777
|
2019-05-01 13:49:01 +08:00
|
|
|
# RUN: llvm-readobj --file-headers %t2 | FileCheck -check-prefix=OCT %s
|
2015-10-15 06:20:57 +08:00
|
|
|
# OCT: Entry: 0x1FF
|
|
|
|
|
2015-11-20 10:32:35 +08:00
|
|
|
.globl entry
|
2016-11-24 06:41:00 +08:00
|
|
|
.text
|
|
|
|
.quad 0
|
2015-11-20 10:32:35 +08:00
|
|
|
entry:
|
2016-11-24 06:41:00 +08:00
|
|
|
ret
|