blob: 82055b7a104a9bdee2dd9f5191d2ca64a57de946 [file] [log] [blame]
Rafael Espindola3c9cb4b2015-08-05 12:03:341// 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 Espindola9c8904f2015-11-18 06:11:013// RUN: ld.lld -shared %tb.o -o %ti686.so
Rui Ueyamae7e33482015-10-13 16:03:394// RUN: llvm-mc -filetype=obj -triple=aarch64-unknown-linux %s -o %tc.o
Rafael Espindola3c9cb4b2015-08-05 12:03:345
Rafael Espindola9c8904f2015-11-18 06:11:016// RUN: not ld.lld %ta.o %tb.o -o %t 2>&1 | \
Rafael Espindola3c9cb4b2015-08-05 12:03:347// RUN: FileCheck --check-prefix=A-AND-B %s
Denis Protivensky1ef7b3f2015-10-07 09:13:038// A-AND-B: b.o is incompatible with {{.*}}a.o
Rafael Espindola3c9cb4b2015-08-05 12:03:349
Rafael Espindola9c8904f2015-11-18 06:11:0110// RUN: not ld.lld %tb.o %tc.o -o %t 2>&1 | \
Rafael Espindola3c9cb4b2015-08-05 12:03:3411// RUN: FileCheck --check-prefix=B-AND-C %s
Denis Protivensky1ef7b3f2015-10-07 09:13:0312// B-AND-C: c.o is incompatible with {{.*}}b.o
Rafael Espindola3c9cb4b2015-08-05 12:03:3413
Rafael Espindola9c8904f2015-11-18 06:11:0114// RUN: not ld.lld %ta.o %ti686.so -o %t 2>&1 | \
Rafael Espindolaf98d6d82015-09-03 20:03:5415// RUN: FileCheck --check-prefix=A-AND-SO %s
Denis Protivensky1ef7b3f2015-10-07 09:13:0316// A-AND-SO: i686.so is incompatible with {{.*}}a.o
Rafael Espindolaf98d6d82015-09-03 20:03:5417
Rafael Espindola9c8904f2015-11-18 06:11:0118// RUN: not ld.lld %tc.o %ti686.so -o %t 2>&1 | \
Rafael Espindolaf98d6d82015-09-03 20:03:5419// RUN: FileCheck --check-prefix=C-AND-SO %s
Denis Protivensky1ef7b3f2015-10-07 09:13:0320// C-AND-SO: i686.so is incompatible with {{.*}}c.o
Rafael Espindolaf98d6d82015-09-03 20:03:5421
Rafael Espindola9c8904f2015-11-18 06:11:0122// RUN: not ld.lld %ti686.so %tc.o -o %t 2>&1 | \
Rafael Espindolaf98d6d82015-09-03 20:03:5423// RUN: FileCheck --check-prefix=SO-AND-C %s
Denis Protivensky1ef7b3f2015-10-07 09:13:0324// SO-AND-C: c.o is incompatible with {{.*}}i686.so
25
Rafael Espindola9c8904f2015-11-18 06:11:0126// RUN: not ld.lld -m elf64ppc %ta.o -o %t 2>&1 | \
Denis Protivensky1ef7b3f2015-10-07 09:13:0327// RUN: FileCheck --check-prefix=A-ONLY %s
Rui Ueyama3ce825e2015-10-09 21:07:2528// A-ONLY: a.o is incompatible with elf64ppc
Denis Protivensky1ef7b3f2015-10-07 09:13:0329
Rafael Espindola9c8904f2015-11-18 06:11:0130// RUN: not ld.lld -m elf64ppc %tb.o -o %t 2>&1 | \
Denis Protivensky1ef7b3f2015-10-07 09:13:0331// RUN: FileCheck --check-prefix=B-ONLY %s
Rui Ueyama3ce825e2015-10-09 21:07:2532// B-ONLY: b.o is incompatible with elf64ppc
Denis Protivensky1ef7b3f2015-10-07 09:13:0333
Rafael Espindola9c8904f2015-11-18 06:11:0134// RUN: not ld.lld -m elf64ppc %tc.o -o %t 2>&1 | \
Denis Protivensky1ef7b3f2015-10-07 09:13:0335// RUN: FileCheck --check-prefix=C-ONLY %s
Rui Ueyama3ce825e2015-10-09 21:07:2536// C-ONLY: c.o is incompatible with elf64ppc
Denis Protivensky1ef7b3f2015-10-07 09:13:0337
Rafael Espindola9c8904f2015-11-18 06:11:0138// RUN: not ld.lld -m elf_i386 %tc.o %ti686.so -o %t 2>&1 | \
Denis Protivensky1ef7b3f2015-10-07 09:13:0339// RUN: FileCheck --check-prefix=C-AND-SO-I386 %s
Rui Ueyama3ce825e2015-10-09 21:07:2540// C-AND-SO-I386: c.o is incompatible with elf_i386
Denis Protivensky1ef7b3f2015-10-07 09:13:0341
Rafael Espindola9c8904f2015-11-18 06:11:0142// RUN: not ld.lld -m elf_i386 %ti686.so %tc.o -o %t 2>&1 | \
Denis Protivensky1ef7b3f2015-10-07 09:13:0343// RUN: FileCheck --check-prefix=SO-AND-C-I386 %s
Rui Ueyama3ce825e2015-10-09 21:07:2544// SO-AND-C-I386: c.o is incompatible with elf_i386
Rafael Espindolaf98d6d82015-09-03 20:03:5445
Rafael Espindola525914d2015-10-11 03:36:4946
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 Espindola9c8904f2015-11-18 06:11:0152// RUN: not ld.lld %t.a %tb.o 2>&1 | FileCheck --check-prefix=ARCHIVE %s
Rafael Espindola525914d2015-10-11 03:36:4953// ARCHIVE: a.o is incompatible with {{.*}}b.o
54.global _start
55_start:
Rafael Espindolacceacd72016-04-30 00:49:1056.data
Rafael Espindola525914d2015-10-11 03:36:4957 .long foo
58
Rui Ueyamae7e33482015-10-13 16:03:3959// REQUIRES: x86,aarch64