James Henderson | 0018ca8 | 2018-01-22 10:58:06 +0000 | [diff] [blame] | 1 | # REQUIRES: x86 |
2 | |||||
3 | # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o | ||||
4 | |||||
5 | # Sanity check that the link will fail with the undefined error without | ||||
6 | # gc-sections. | ||||
7 | # RUN: not ld.lld %t.o -o %t 2>&1 | FileCheck %s | ||||
8 | # CHECK: error: undefined symbol: undefined | ||||
9 | |||||
10 | # RUN: ld.lld %t.o --gc-sections -o %t | ||||
11 | |||||
12 | .section .text.unused,"ax",@progbits | ||||
13 | unused: | ||||
14 | callq undefined | ||||
15 | |||||
16 | .text | ||||
17 | .global _start | ||||
18 | _start: | ||||
19 | nop |