]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/ELF/incompatible.s
Vendor import of lld trunk r338150:
[FreeBSD/FreeBSD.git] / test / ELF / incompatible.s
1 // REQUIRES: x86,aarch64
2 // RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %ta.o
3 // RUN: llvm-mc -filetype=obj -triple=i686-unknown-linux %s -o %tb.o
4 // RUN: ld.lld -shared %tb.o -o %ti686.so
5 // RUN: llvm-mc -filetype=obj -triple=aarch64-unknown-linux %s -o %tc.o
6
7 // RUN: not ld.lld %ta.o %tb.o -o %t 2>&1 | \
8 // RUN:   FileCheck --check-prefix=A-AND-B %s
9 // A-AND-B: b.o is incompatible with {{.*}}a.o
10
11 // RUN: not ld.lld %tb.o %tc.o -o %t 2>&1 | \
12 // RUN:   FileCheck --check-prefix=B-AND-C %s
13 // B-AND-C: c.o is incompatible with {{.*}}b.o
14
15 // RUN: not ld.lld %ta.o %ti686.so -o %t 2>&1 | \
16 // RUN:   FileCheck --check-prefix=A-AND-SO %s
17 // A-AND-SO: i686.so is incompatible with {{.*}}a.o
18
19 // RUN: not ld.lld %tc.o %ti686.so -o %t 2>&1 | \
20 // RUN:   FileCheck --check-prefix=C-AND-SO %s
21 // C-AND-SO: i686.so is incompatible with {{.*}}c.o
22
23 // RUN: not ld.lld %ti686.so %tc.o -o %t 2>&1 | \
24 // RUN:   FileCheck --check-prefix=SO-AND-C %s
25 // SO-AND-C: c.o is incompatible with {{.*}}i686.so
26
27 // RUN: not ld.lld -m elf64ppc %ta.o -o %t 2>&1 | \
28 // RUN:   FileCheck --check-prefix=A-ONLY %s
29 // A-ONLY: a.o is incompatible with elf64ppc
30
31 // RUN: not ld.lld -m elf64ppc %tb.o -o %t 2>&1 | \
32 // RUN:   FileCheck --check-prefix=B-ONLY %s
33 // B-ONLY: b.o is incompatible with elf64ppc
34
35 // RUN: not ld.lld -m elf64ppc %tc.o -o %t 2>&1 | \
36 // RUN:   FileCheck --check-prefix=C-ONLY %s
37 // C-ONLY: c.o is incompatible with elf64ppc
38
39 // RUN: not ld.lld -m elf_i386 %tc.o %ti686.so -o %t 2>&1 | \
40 // RUN:   FileCheck --check-prefix=C-AND-SO-I386 %s
41 // C-AND-SO-I386: c.o is incompatible with elf_i386
42
43 // RUN: not ld.lld -m elf_i386 %ti686.so %tc.o -o %t 2>&1 | \
44 // RUN:   FileCheck --check-prefix=SO-AND-C-I386 %s
45 // SO-AND-C-I386: c.o is incompatible with elf_i386
46
47
48 // We used to fail to identify this incompatibility and crash trying to
49 // read a 64 bit file as a 32 bit one.
50 // RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %p/Inputs/archive2.s -o %ta.o
51 // RUN: llvm-ar rc %t.a %ta.o
52 // RUN: llvm-mc -filetype=obj -triple=i686-linux %s -o %tb.o
53 // RUN: not ld.lld %t.a %tb.o 2>&1 -o %t | FileCheck --check-prefix=ARCHIVE %s
54 // ARCHIVE: .a({{.*}}a.o) is incompatible with {{.*}}b.o
55 .global _start
56 _start:
57 .data
58         .long foo
59