1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-18 18:42:46 +02:00

[LTO] Reject modules without datalayout.

Also, udpate the ~60 failing tests in the tree which did
not contain a valid datalayout.
This fixes PR31123. lld will be updated in a following patch,
immediately after this is committed.

Differential Revision:  https://reviews.llvm.org/D27082

llvm-svn: 289719
This commit is contained in:
Davide Italiano 2016-12-14 21:57:04 +00:00
parent 0ed7767039
commit 4ca4bcedf1
90 changed files with 162 additions and 10 deletions

View File

@ -380,6 +380,11 @@ Error LTO::addModule(InputFile &Input, InputFile::InputModule &IM,
const SymbolResolution *ResE) {
// FIXME: move to backend
Module &M = *IM.Mod;
if (M.getDataLayoutStr().empty())
return make_error<StringError>("input module has no datalayout",
inconvertibleErrorCode());
if (!Conf.OverrideTriple.empty())
M.setTargetTriple(Conf.OverrideTriple);
else if (M.getTargetTriple().empty())

View File

@ -191,7 +191,6 @@ static void runOldPMPasses(Config &Conf, Module &Mod, TargetMachine *TM,
bool opt(Config &Conf, TargetMachine *TM, unsigned Task, Module &Mod,
bool IsThinLTO) {
Mod.setDataLayout(TM->createDataLayout());
if (Conf.OptPipeline.empty())
runOldPMPasses(Conf, Mod, TM, IsThinLTO);
else

View File

@ -233,7 +233,6 @@ LTOModule::makeLTOModule(MemoryBufferRef Buffer, const TargetOptions &options,
TargetMachine *target =
march->createTargetMachine(TripleStr, CPU, FeatureStr, options, None);
M->setDataLayout(target->createDataLayout());
std::unique_ptr<LTOModule> Ret(new LTOModule(std::move(M), Buffer, target));
Ret->parseSymbols();

View File

@ -1,7 +1,8 @@
target triple = "x86_64-apple-macosx10.11.0"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
@v = common global i16 0, align 4
define i16 *@bar() {
ret i16 *@v
}
}

View File

@ -1,3 +1,4 @@
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
declare i32 @g()
define i32 @main() {

View File

@ -70,9 +70,8 @@
; RUN: -r %t2.bc,bar,px
; RUN: llvm-dis < %t.o.0.0.preopt.bc | FileCheck %s --check-prefix=BOTH-PREVAILED2
target triple = "x86_64-apple-macosx10.11.0"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
@v = common global i8 0, align 8

View File

@ -19,6 +19,7 @@
; RUN: llvm-nm %t5.o.0 | FileCheck %s --check-prefix=NM0
; RUN: llvm-nm %t5.o.1 | FileCheck %s --check-prefix=NM1
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
define i32 @g() {
ret i32 0

View File

@ -19,6 +19,7 @@
; YAML-NEXT: - Caller: main
; YAML-NEXT: ...
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-darwin"
declare i32 @bar()

View File

@ -54,6 +54,7 @@
; YAML-NEXT: - Caller: main
; YAML-NEXT: ...
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-darwin"
declare i32 @bar()

View File

@ -5,6 +5,7 @@
; rdar://problem/16165191
; runtime library implementations should not be renamed
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-darwin11"
@str = private unnamed_addr constant [13 x i8] c"hello world\0A\00"

View File

@ -2,8 +2,7 @@
; RUN: llvm-lto -exported-symbol=_main -o %t2 %t1
; RUN: llvm-nm %t2 | FileCheck %s
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.9"
declare double @pow(double, double)

View File

@ -1,3 +1,5 @@
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
@G = internal global i32 7
define i32 @g() {
entry:

View File

@ -11,6 +11,8 @@
; RUN: llvm-dis -o - %t2.out | FileCheck %s
; CHECK: @G.llvm.0
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
declare i32 @g(...)
define void @f() {

View File

@ -1 +1,3 @@
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
@a = global i32 42

View File

@ -1,3 +1,5 @@
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
define void @zed() {
ret void
}

View File

@ -1,3 +1,4 @@
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
define i32 @main() {

View File

@ -1,3 +1,5 @@
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
$c2 = comdat any
$c1 = comdat any

View File

@ -1,3 +1,5 @@
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
$foo = comdat any
@foo = global i8 1, comdat
define void @zed() {

View File

@ -1 +1,3 @@
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
@a = common global i32 0, align 4

View File

@ -1 +1,3 @@
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
@a = common global i8 0, align 16

View File

@ -1 +1,3 @@
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
@a = common global i8 0, align 1

View File

@ -1,3 +1,5 @@
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @bar, i8* null }]
define void @bar() {

View File

@ -1,3 +1,5 @@
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
$foo = comdat any
define linkonce void @foo() comdat {
ret void

View File

@ -1,3 +1,5 @@
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
!0 = !{ i32 1, !"foo", i32 2 }
!llvm.module.flags = !{ !0 }

View File

@ -1,3 +1,5 @@
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
define weak_odr void @f() !dbg !4 {
ret void, !dbg !10
}

View File

@ -1,3 +1,4 @@
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
declare i32 @g()
define i32 @main() {

View File

@ -1,3 +1,4 @@
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
define linkonce_odr hidden void @f() {
ret void

View File

@ -1,3 +1,5 @@
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
@bar = alias void (), void ()* @zed
define void @zed() {
ret void

View File

@ -1 +1,3 @@
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
@x = common global i32 0, align 8

View File

@ -1,3 +1,5 @@
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
define void @g() {
entry:
ret void

View File

@ -1,3 +1,4 @@
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
define weak void @weakfunc() {
entry:

View File

@ -1,3 +1,5 @@
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
define void @g() {
entry:
ret void

View File

@ -1,3 +1,5 @@
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
define void @h() {
entry:
ret void

View File

@ -0,0 +1 @@
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"

View File

@ -1,3 +1,4 @@
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
declare i32 @g()
define i32 @main() {

View File

@ -1,3 +1,4 @@
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
define linkonce_odr hidden void @f() {
ret void

View File

@ -1,3 +1,4 @@
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
; Alias are not optimized

View File

@ -1,3 +1,5 @@
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
define void @zed() {
call void @bar()
ret void

View File

@ -1,3 +1,5 @@
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
%zed = type { i16 }
define void @bar(%zed* %this) {
store %zed* %this, %zed** null

View File

@ -1,3 +1,5 @@
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
define void @foo() {
ret void
}

View File

@ -1,2 +1,4 @@
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
@a = weak global i32 41
@c = global i32* @a

View File

@ -9,5 +9,7 @@
; CHECK-NEXT: @b = global i32 1
; CHECK-NOT: alias
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
@a = weak alias i32, i32* @b
@b = global i32 1

View File

@ -2,6 +2,8 @@
; RUN: %gold -shared -o %t2.bc -plugin %llvmshlibdir/LLVMgold.so %t.o -plugin-opt=emit-llvm
; RUN: llvm-dis %t2.bc -o - | FileCheck %s
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
@bar = alias void (), void ()* @zed
define void @foo() {
call void @bar()

View File

@ -11,6 +11,8 @@
; RUN: -shared %t2.o %t.o -o %t3.o
; RUN: llvm-dis %t3.o -o - | FileCheck %s
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
define void @foo() {
call void @bar()
call void @zed()

View File

@ -6,6 +6,8 @@
; CHECK: Unable to determine comdat of alias!
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
@g1 = global i32 1
@g2 = global i32 2

View File

@ -5,6 +5,7 @@
; RUN: %gold -r -o %T/bcsection.o -m elf_x86_64 -plugin %llvmshlibdir/LLVMgold.so %T/bcsection.bco
; RUN: llvm-nm -no-llvm-bc %T/bcsection.o | FileCheck %s
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-unknown"
; CHECK: main

View File

@ -24,6 +24,7 @@
; RUN: ls %t.cache | count 2
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
define void @globalfunc() #0 {

View File

@ -3,7 +3,7 @@
; RUN: -shared %t.o -o %t2.o
; RUN: llvm-dis %t2.o -o - | FileCheck %s
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target datalayout = "m:w"
; CHECK: define void @f() {

View File

@ -5,6 +5,8 @@
; RUN: FileCheck --check-prefix=RES %s < %t3.o.resolution.txt
; RUN: llvm-readobj -t %t3.o | FileCheck --check-prefix=OBJ %s
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
$c1 = comdat any
@v1 = weak_odr global i32 42, comdat($c1)

View File

@ -5,6 +5,7 @@
; RUN: -shared %t.bc %t2.bc -o %t3.bc
; RUN: llvm-dis %t3.bc -o - | FileCheck %s
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
$foo = comdat any
@foo = global i8 0, comdat

View File

@ -3,6 +3,8 @@
; RUN: llvm-as %p/Inputs/common2.ll -o %t2b.o
; RUN: llvm-as %p/Inputs/common3.ll -o %t2c.o
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
@a = common global i16 0, align 8
; RUN: %gold -plugin %llvmshlibdir/LLVMgold.so \

View File

@ -4,6 +4,8 @@
; RUN: -shared %t.o -o %t2.o
; RUN: llvm-dis %t2.o -o - | FileCheck %s
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @foo, i8* null }]
define internal void @foo() {

View File

@ -5,6 +5,8 @@
; RUN: -shared %t.o %t2.o -o %t3.o
; RUN: llvm-dis %t3.o -o - | FileCheck %s
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @foo, i8* null }]
define void @foo() {

View File

@ -10,6 +10,7 @@
; RUN: --plugin-opt=-debug-pass=Arguments \
; RUN: -shared %t.o -o %t2.o 2>&1 | FileCheck %s -check-prefix=VERIFY
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
; -disable-verify should disable output verification from the optimization

View File

@ -7,6 +7,8 @@
; RUN: -shared %t.o %t2.o -o %t3.o
; RUN: llvm-dis %t3.o -o - | FileCheck %s
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
define void @foo() {
ret void
}

View File

@ -22,6 +22,7 @@
; NM: T f3
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
; CHECK-DAG: @g1 = weak_odr constant i32 32

View File

@ -4,6 +4,8 @@
; CHECK: fatal error: Failed to link module {{.*}}2.bc: linking module flags 'foo': IDs have conflicting values
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
!0 = !{ i32 1, !"foo", i32 1 }
!llvm.module.flags = !{ !0 }

View File

@ -6,6 +6,8 @@
; RUN: -version-script=%p/Inputs/linker-script.export
; RUN: llvm-dis %t2.o -o - | FileCheck %s
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
; CHECK: define void @f()
define void @f() {
ret void

View File

@ -11,6 +11,8 @@
; RUN: -shared %t2.o %t.o -o %t3.o
; RUN: llvm-dis %t3.o -o - | FileCheck %s
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
define linkonce_odr void @f() !dbg !4 {
ret void, !dbg !10
}

View File

@ -12,6 +12,7 @@
; CHECK-DAG: T main
; CHECK-DAG: T g
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
define i32 @g() {
ret i32 0

View File

@ -4,6 +4,9 @@
; RUN: llvm-dis < %t2.bc -o - | FileCheck %s
; CHECK: main
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
define i32 @main() {
ret i32 0
}

View File

@ -12,6 +12,9 @@
; CHECK-O0: define internal void @foo(
; CHECK-O1: define internal void @foo(
; CHECK-O2-NOT: define internal void @foo(
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
define internal void @foo() {
ret void
}

View File

@ -6,6 +6,7 @@
; RUN: llvm-nm %t.o0 | FileCheck --check-prefix=CHECK0 %s
; RUN: llvm-nm %t.o1 | FileCheck --check-prefix=CHECK1 %s
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
; CHECK-BC0: define void @foo

View File

@ -15,6 +15,7 @@
; CHECK: Section: .text
; CHECK-NEXT: }
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
define i32 @g() {
call void @f()

View File

@ -16,6 +16,7 @@
; CHECK: Section: .text
; CHECK-NEXT: }
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
define i32 @g() {
call void @f()

View File

@ -4,6 +4,8 @@
; RUN: llvm-nm %t2 | FileCheck %s
; CHECK: T main
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
@main.L = internal unnamed_addr constant [3 x i8*] [i8* blockaddress(@main, %L1), i8* blockaddress(@main, %L2), i8* null], align 16
define i32 @main() #0 {

View File

@ -5,6 +5,8 @@
; RUN: llvm-dis %t2 -o - | FileCheck %s
; CHECK-NOT: subprograms
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!3, !4}
!llvm.ident = !{!5}

View File

@ -7,6 +7,7 @@
; Test that we produce R_X86_64_GOTPCREL instead of R_X86_64_GOTPCRELX
; CHECK: R_X86_64_GOTPCREL foo
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
@foo = external global i32

View File

@ -15,6 +15,8 @@
; RUN: FileCheck --check-prefix=PASS1 %s < %t.ll
; RUN: FileCheck --check-prefix=PASS2 %s < %t.ll
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
define void @foo() {
call void @bar()
ret void

View File

@ -8,6 +8,7 @@
; test that the vectorizer is run.
; CHECK: fadd <4 x float>
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
define void @f(float* nocapture %x) {

View File

@ -9,6 +9,7 @@
; RUN: -shared %t1.o --start-lib %t2.o --end-lib -o %t3.o
; RUN: llvm-dis %t3.o -o - | FileCheck %s
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
@x = common global i32 0, align 4
; ToT gold (as of 03/2016) honors --start-lib/--end-lib, drops %t2.o and ends up

View File

@ -24,6 +24,8 @@
; NONAME: %3 = add i32 %0, %2
; NONAME: ret i32 %3
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
@GlobalValueName = global i32 0
define i32 @foo(i32 %in) {

View File

@ -115,6 +115,8 @@
; COMBINED-NEXT: <COMBINED_ENTRY abbrevid={{[0-9]+}} op0={{1|2}} op1={{-3706093650706652785|-5300342847281564238}}
; COMBINED-NEXT: </VALUE_SYMTAB
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
declare void @g(...)
define void @f() {

View File

@ -27,6 +27,7 @@
; OPT: define hidden void @weakfunc.llvm.0()
; OPT2: define weak void @weakfunc()
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
@weakfuncAlias = alias void (...), bitcast (void ()* @weakfunc to void (...)*)

View File

@ -15,6 +15,8 @@
; RUN: -shared %t.o %t.a -o %t4 2>&1 | FileCheck %s
; RUN: llvm-nm %t4 | FileCheck %s --check-prefix=NM
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
; CHECK-DAG: Import g
declare void @g(...)
; CHECK-DAG: Import h

View File

@ -28,6 +28,8 @@
; The index file should be created even for the input with an empty summary.
; RUN: ls %t3.o.thinlto.bc
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
declare void @g(...)
define void @f() {

View File

@ -14,6 +14,7 @@
; h() should be internalized after promotion, and eliminated after inlining
; CHECK-NOT: @h.llvm.
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
define i32 @g() {
call void @f()

View File

@ -23,6 +23,7 @@
; OPT-NOT: @f()
; OPT2: define weak_odr hidden void @f()
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
define i32 @g() {
call void @f()

View File

@ -11,6 +11,8 @@
; RUN: -shared %T/oldpath/thinlto_prefix_replace.o -o %T/thinlto_prefix_replace
; RUN: ls %T/newpath/thinlto_prefix_replace.o.thinlto.bc
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
define void @f() {
entry:
ret void

View File

@ -26,6 +26,7 @@
; RUN: llvm-dis %t.o.3.import.bc -o - | FileCheck --check-prefix=IMPORT %s
; RUN llvm-dis %t2.o.3.import.bc -o - | FileCheck --check-prefix=IMPORT2 %s
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

View File

@ -5,6 +5,8 @@
; RUN: -shared %t.o %t2.o -o %t3.o
; RUN: llvm-dis %t3.o -o - | FileCheck %s
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
define void @foo() {
call void @bar(i8* null)
ret void

View File

@ -5,6 +5,8 @@
; RUN: -shared %t.o %t2.o -o %t3.o
; RUN: llvm-dis %t3.o.0.2.internalize.bc -o - | FileCheck %s
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
%zed = type { i8 }
define void @foo() {
call void @bar(%zed* null)

View File

@ -5,6 +5,8 @@
; RUN: -shared %t.o -o %t2.o
; RUN: llvm-dis %t2.o -o - | FileCheck %s
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
@a = internal unnamed_addr constant i8 42
define i8* @f() {

View File

@ -18,6 +18,8 @@
; IR: define void @foo
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
define weak protected void @foo() {
ret void
}

View File

@ -6,6 +6,8 @@
; RUN: -shared %t.o %t2.o -o %t3.o
; RUN: llvm-dis %t3.o -o - | FileCheck %s
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
@a = weak global i32 42
@b = global i32* @a

View File

@ -1,3 +1,5 @@
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
define void @g() {
entry:
ret void

View File

@ -21,6 +21,8 @@
; COMBINED-NEXT: <COMBINED_ENTRY abbrevid={{[0-9]+}} op0={{1|2}} op1={{-3706093650706652785|-5300342847281564238}}
; COMBINED-NEXT: </VALUE_SYMTAB
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
define void @f() {
entry:
ret void

View File

@ -0,0 +1,13 @@
; RUN: llvm-as < %s > %t1.bc
; Reject input modules without a datalayout.
; RUN: not llvm-lto2 %t1.bc -o %t.o \
; RUN: -r %t1.bc,patatino,px 2>&1 | FileCheck %s
; CHECK: input module has no datalayout
target triple = "x86_64-unknown-linux-gnu"
define void @patatino() {
ret void
}

View File

@ -6,6 +6,7 @@
; RUN: -aa-pipeline basic-aa
; RUN: llvm-dis < %t.o.0.4.opt.bc | FileCheck %s --check-prefix=CUSTOM
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
define void @patatino() {

View File

@ -8,4 +8,7 @@
; ERR2: unused symbol resolution for {{.*}}.bc,bar
; ERR3: invalid character q in resolution: {{.*}}.bc,foo
; ERR4: invalid resolution: foo
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
@foo = global i32 0