Rafael Espindola | 3c9cb4b | 2015-08-05 12:03:34 | [diff] [blame] | 1 | // RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %ta.o |
| 2 | // RUN: llvm-mc -filetype=obj -triple=i686-unknown-linux %s -o %tb.o |
Rafael Espindola | 9c8904f | 2015-11-18 06:11:01 | [diff] [blame] | 3 | // RUN: ld.lld -shared %tb.o -o %ti686.so |
Rui Ueyama | e7e3348 | 2015-10-13 16:03:39 | [diff] [blame] | 4 | // RUN: llvm-mc -filetype=obj -triple=aarch64-unknown-linux %s -o %tc.o |
Rafael Espindola | 3c9cb4b | 2015-08-05 12:03:34 | [diff] [blame] | 5 | |
Rafael Espindola | 9c8904f | 2015-11-18 06:11:01 | [diff] [blame] | 6 | // RUN: not ld.lld %ta.o %tb.o -o %t 2>&1 | \ |
Rafael Espindola | 3c9cb4b | 2015-08-05 12:03:34 | [diff] [blame] | 7 | // RUN: FileCheck --check-prefix=A-AND-B %s |
Denis Protivensky | 1ef7b3f | 2015-10-07 09:13:03 | [diff] [blame] | 8 | // A-AND-B: b.o is incompatible with {{.*}}a.o |
Rafael Espindola | 3c9cb4b | 2015-08-05 12:03:34 | [diff] [blame] | 9 | |
Rafael Espindola | 9c8904f | 2015-11-18 06:11:01 | [diff] [blame] | 10 | // RUN: not ld.lld %tb.o %tc.o -o %t 2>&1 | \ |
Rafael Espindola | 3c9cb4b | 2015-08-05 12:03:34 | [diff] [blame] | 11 | // RUN: FileCheck --check-prefix=B-AND-C %s |
Denis Protivensky | 1ef7b3f | 2015-10-07 09:13:03 | [diff] [blame] | 12 | // B-AND-C: c.o is incompatible with {{.*}}b.o |
Rafael Espindola | 3c9cb4b | 2015-08-05 12:03:34 | [diff] [blame] | 13 | |
Rafael Espindola | 9c8904f | 2015-11-18 06:11:01 | [diff] [blame] | 14 | // RUN: not ld.lld %ta.o %ti686.so -o %t 2>&1 | \ |
Rafael Espindola | f98d6d8 | 2015-09-03 20:03:54 | [diff] [blame] | 15 | // RUN: FileCheck --check-prefix=A-AND-SO %s |
Denis Protivensky | 1ef7b3f | 2015-10-07 09:13:03 | [diff] [blame] | 16 | // A-AND-SO: i686.so is incompatible with {{.*}}a.o |
Rafael Espindola | f98d6d8 | 2015-09-03 20:03:54 | [diff] [blame] | 17 | |
Rafael Espindola | 9c8904f | 2015-11-18 06:11:01 | [diff] [blame] | 18 | // RUN: not ld.lld %tc.o %ti686.so -o %t 2>&1 | \ |
Rafael Espindola | f98d6d8 | 2015-09-03 20:03:54 | [diff] [blame] | 19 | // RUN: FileCheck --check-prefix=C-AND-SO %s |
Denis Protivensky | 1ef7b3f | 2015-10-07 09:13:03 | [diff] [blame] | 20 | // C-AND-SO: i686.so is incompatible with {{.*}}c.o |
Rafael Espindola | f98d6d8 | 2015-09-03 20:03:54 | [diff] [blame] | 21 | |
Rafael Espindola | 9c8904f | 2015-11-18 06:11:01 | [diff] [blame] | 22 | // RUN: not ld.lld %ti686.so %tc.o -o %t 2>&1 | \ |
Rafael Espindola | f98d6d8 | 2015-09-03 20:03:54 | [diff] [blame] | 23 | // RUN: FileCheck --check-prefix=SO-AND-C %s |
Denis Protivensky | 1ef7b3f | 2015-10-07 09:13:03 | [diff] [blame] | 24 | // SO-AND-C: c.o is incompatible with {{.*}}i686.so |
| 25 | |
Rafael Espindola | 9c8904f | 2015-11-18 06:11:01 | [diff] [blame] | 26 | // RUN: not ld.lld -m elf64ppc %ta.o -o %t 2>&1 | \ |
Denis Protivensky | 1ef7b3f | 2015-10-07 09:13:03 | [diff] [blame] | 27 | // RUN: FileCheck --check-prefix=A-ONLY %s |
Rui Ueyama | 3ce825e | 2015-10-09 21:07:25 | [diff] [blame] | 28 | // A-ONLY: a.o is incompatible with elf64ppc |
Denis Protivensky | 1ef7b3f | 2015-10-07 09:13:03 | [diff] [blame] | 29 | |
Rafael Espindola | 9c8904f | 2015-11-18 06:11:01 | [diff] [blame] | 30 | // RUN: not ld.lld -m elf64ppc %tb.o -o %t 2>&1 | \ |
Denis Protivensky | 1ef7b3f | 2015-10-07 09:13:03 | [diff] [blame] | 31 | // RUN: FileCheck --check-prefix=B-ONLY %s |
Rui Ueyama | 3ce825e | 2015-10-09 21:07:25 | [diff] [blame] | 32 | // B-ONLY: b.o is incompatible with elf64ppc |
Denis Protivensky | 1ef7b3f | 2015-10-07 09:13:03 | [diff] [blame] | 33 | |
Rafael Espindola | 9c8904f | 2015-11-18 06:11:01 | [diff] [blame] | 34 | // RUN: not ld.lld -m elf64ppc %tc.o -o %t 2>&1 | \ |
Denis Protivensky | 1ef7b3f | 2015-10-07 09:13:03 | [diff] [blame] | 35 | // RUN: FileCheck --check-prefix=C-ONLY %s |
Rui Ueyama | 3ce825e | 2015-10-09 21:07:25 | [diff] [blame] | 36 | // C-ONLY: c.o is incompatible with elf64ppc |
Denis Protivensky | 1ef7b3f | 2015-10-07 09:13:03 | [diff] [blame] | 37 | |
Rafael Espindola | 9c8904f | 2015-11-18 06:11:01 | [diff] [blame] | 38 | // RUN: not ld.lld -m elf_i386 %tc.o %ti686.so -o %t 2>&1 | \ |
Denis Protivensky | 1ef7b3f | 2015-10-07 09:13:03 | [diff] [blame] | 39 | // RUN: FileCheck --check-prefix=C-AND-SO-I386 %s |
Rui Ueyama | 3ce825e | 2015-10-09 21:07:25 | [diff] [blame] | 40 | // C-AND-SO-I386: c.o is incompatible with elf_i386 |
Denis Protivensky | 1ef7b3f | 2015-10-07 09:13:03 | [diff] [blame] | 41 | |
Rafael Espindola | 9c8904f | 2015-11-18 06:11:01 | [diff] [blame] | 42 | // RUN: not ld.lld -m elf_i386 %ti686.so %tc.o -o %t 2>&1 | \ |
Denis Protivensky | 1ef7b3f | 2015-10-07 09:13:03 | [diff] [blame] | 43 | // RUN: FileCheck --check-prefix=SO-AND-C-I386 %s |
Rui Ueyama | 3ce825e | 2015-10-09 21:07:25 | [diff] [blame] | 44 | // SO-AND-C-I386: c.o is incompatible with elf_i386 |
Rafael Espindola | f98d6d8 | 2015-09-03 20:03:54 | [diff] [blame] | 45 | |
Rafael Espindola | 525914d | 2015-10-11 03:36:49 | [diff] [blame] | 46 | |
| 47 | // We used to fail to identify this incompatibility and crash trying to |
| 48 | // read a 64 bit file as a 32 bit one. |
| 49 | // RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %p/Inputs/archive2.s -o %ta.o |
| 50 | // RUN: llvm-ar rc %t.a %ta.o |
| 51 | // RUN: llvm-mc -filetype=obj -triple=i686-linux %s -o %tb.o |
Rafael Espindola | 9c8904f | 2015-11-18 06:11:01 | [diff] [blame] | 52 | // RUN: not ld.lld %t.a %tb.o 2>&1 | FileCheck --check-prefix=ARCHIVE %s |
Rafael Espindola | 525914d | 2015-10-11 03:36:49 | [diff] [blame] | 53 | // ARCHIVE: a.o is incompatible with {{.*}}b.o |
| 54 | .global _start |
| 55 | _start: |
Rafael Espindola | cceacd7 | 2016-04-30 00:49:10 | [diff] [blame] | 56 | .data |
Rafael Espindola | 525914d | 2015-10-11 03:36:49 | [diff] [blame] | 57 | .long foo |
| 58 | |
Rui Ueyama | e7e3348 | 2015-10-13 16:03:39 | [diff] [blame] | 59 | // REQUIRES: x86,aarch64 |