Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / MachO / invalid / range-check.s
blob688499fec1c807811649ca63b45c84957267e8e6
1 # REQUIRES: x86
3 # RUN: rm -rf %t; split-file %s %t
4 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/test.s -o %t/test.o
5 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/bar.s -o %t/bar.o
6 # RUN: %lld -dylib %t/bar.o -o %t/libbar.dylib
7 # RUN: not %lld -lSystem -o /dev/null %t/libbar.dylib %t/test.o 2>&1 | FileCheck %s
9 # CHECK-DAG: error: {{.*}}test.o:(symbol _main+0xd): relocation UNSIGNED is out of range: [[#]] is not in [0, 4294967295]; references _foo
10 # CHECK-DAG: error: {{.*}}test.o:(symbol _main+0x3): relocation GOT_LOAD is out of range: [[#]] is not in [-2147483648, 2147483647]; references _foo
11 # CHECK-DAG: error: stub is out of range: [[#]] is not in [-2147483648, 2147483647]; references _bar
12 # CHECK-DAG: error: stub helper header is out of range: [[#]] is not in [-2147483648, 2147483647]
13 # CHECK-DAG: error: stub helper header is out of range: [[#]] is not in [-2147483648, 2147483647]
15 #--- bar.s
16 .globl _bar
17 _bar:
19 #--- test.s
21 # Added to ensure that the error mentions the right function.
22 _baz:
23 ret
25 .globl _main, _foo
27 _main:
28 movq _foo@GOTPCREL(%rip), %rax
29 callq _bar
30 ret
32 .int _foo
33 .zerofill __TEXT,bss,_zero,0xffffffff
35 .data
36 _foo:
37 .space 0