diff options
Diffstat (limited to 'test/LTO')
-rw-r--r-- | test/LTO/ARM/inline-asm.ll | 9 | ||||
-rw-r--r-- | test/LTO/ARM/lit.local.cfg | 2 | ||||
-rw-r--r-- | test/LTO/ARM/runtime-library-subtarget.ll | 18 | ||||
-rw-r--r-- | test/LTO/X86/Inputs/bcsection.macho.s (renamed from test/LTO/Inputs/bcsection.macho.s) | 0 | ||||
-rw-r--r-- | test/LTO/X86/Inputs/bcsection.s (renamed from test/LTO/Inputs/bcsection.s) | 0 | ||||
-rw-r--r-- | test/LTO/X86/Inputs/invalid.ll.bc | bin | 0 -> 332 bytes | |||
-rw-r--r-- | test/LTO/X86/Inputs/list-symbols.ll | 4 | ||||
-rw-r--r-- | test/LTO/X86/attrs.ll (renamed from test/LTO/attrs.ll) | 0 | ||||
-rw-r--r-- | test/LTO/X86/bcsection.ll (renamed from test/LTO/bcsection.ll) | 0 | ||||
-rw-r--r-- | test/LTO/X86/cfi_endproc.ll (renamed from test/LTO/cfi_endproc.ll) | 5 | ||||
-rw-r--r-- | test/LTO/X86/current-section.ll (renamed from test/LTO/current-section.ll) | 0 | ||||
-rw-r--r-- | test/LTO/X86/diagnostic-handler-remarks.ll (renamed from test/LTO/diagnostic-handler-remarks.ll) | 0 | ||||
-rw-r--r-- | test/LTO/X86/invalid.ll | 4 | ||||
-rw-r--r-- | test/LTO/X86/jump-table-type.ll (renamed from test/LTO/jump-table-type.ll) | 0 | ||||
-rw-r--r-- | test/LTO/X86/keep-used-puts-during-instcombine.ll (renamed from test/LTO/keep-used-puts-during-instcombine.ll) | 0 | ||||
-rw-r--r-- | test/LTO/X86/linkonce_odr_func.ll (renamed from test/LTO/linkonce_odr_func.ll) | 10 | ||||
-rw-r--r-- | test/LTO/X86/list-symbols.ll | 15 | ||||
-rw-r--r-- | test/LTO/X86/lit.local.cfg (renamed from test/LTO/lit.local.cfg) | 0 | ||||
-rw-r--r-- | test/LTO/X86/no-undefined-puts-when-implemented.ll (renamed from test/LTO/no-undefined-puts-when-implemented.ll) | 0 | ||||
-rw-r--r-- | test/LTO/X86/private-symbol.ll (renamed from test/LTO/private-symbol.ll) | 0 | ||||
-rw-r--r-- | test/LTO/X86/runtime-library.ll (renamed from test/LTO/runtime-library.ll) | 0 | ||||
-rw-r--r-- | test/LTO/X86/set-merged.ll | 36 | ||||
-rw-r--r-- | test/LTO/X86/symver-asm.ll (renamed from test/LTO/symver-asm.ll) | 0 | ||||
-rw-r--r-- | test/LTO/X86/triple-init.ll (renamed from test/LTO/triple-init.ll) | 0 |
24 files changed, 103 insertions, 0 deletions
diff --git a/test/LTO/ARM/inline-asm.ll b/test/LTO/ARM/inline-asm.ll new file mode 100644 index 0000000..23fb904 --- /dev/null +++ b/test/LTO/ARM/inline-asm.ll @@ -0,0 +1,9 @@ +; Check that we don't crash on target-specific inline asm directives. +; +; RUN: llvm-as < %s > %t +; RUN: llvm-lto -o /dev/null %t -mcpu armv4t + +target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64" +target triple = "armv4t-unknown-linux" + +module asm ".fnstart" diff --git a/test/LTO/ARM/lit.local.cfg b/test/LTO/ARM/lit.local.cfg new file mode 100644 index 0000000..20e19ae --- /dev/null +++ b/test/LTO/ARM/lit.local.cfg @@ -0,0 +1,2 @@ +if not 'ARM' in config.root.targets: + config.unsupported = True diff --git a/test/LTO/ARM/runtime-library-subtarget.ll b/test/LTO/ARM/runtime-library-subtarget.ll new file mode 100644 index 0000000..aab1d90 --- /dev/null +++ b/test/LTO/ARM/runtime-library-subtarget.ll @@ -0,0 +1,18 @@ +; Check that user-defined runtime library function __addsf3vfp is not removed +; +; RUN: llvm-as <%s >%t1 +; RUN: llvm-lto -o %t2 %t1 -mcpu arm1176jz-s +; RUN: llvm-nm %t2 | FileCheck %s + +target datalayout = "e-m:o-p:32:32-f64:32:64-v64:32:64-v128:32:128-a:0:32-n32-S32" +target triple = "thumbv7-apple-ios" + +; CHECK: ___addsf3vfp + +define float @__addsf3vfp(float %a, float %b) #0 { +entry: + %add = fadd float %a, %b + ret float %add +} + +attributes #0 = { "target-cpu"="arm1176jzf-s"} diff --git a/test/LTO/Inputs/bcsection.macho.s b/test/LTO/X86/Inputs/bcsection.macho.s index cb7fe03..cb7fe03 100644 --- a/test/LTO/Inputs/bcsection.macho.s +++ b/test/LTO/X86/Inputs/bcsection.macho.s diff --git a/test/LTO/Inputs/bcsection.s b/test/LTO/X86/Inputs/bcsection.s index ede1e5c..ede1e5c 100644 --- a/test/LTO/Inputs/bcsection.s +++ b/test/LTO/X86/Inputs/bcsection.s diff --git a/test/LTO/X86/Inputs/invalid.ll.bc b/test/LTO/X86/Inputs/invalid.ll.bc Binary files differnew file mode 100644 index 0000000..a85c364 --- /dev/null +++ b/test/LTO/X86/Inputs/invalid.ll.bc diff --git a/test/LTO/X86/Inputs/list-symbols.ll b/test/LTO/X86/Inputs/list-symbols.ll new file mode 100644 index 0000000..9443d53 --- /dev/null +++ b/test/LTO/X86/Inputs/list-symbols.ll @@ -0,0 +1,4 @@ +@glob = global i32 0 +define void @bar() { + ret void +} diff --git a/test/LTO/attrs.ll b/test/LTO/X86/attrs.ll index d196747..d196747 100644 --- a/test/LTO/attrs.ll +++ b/test/LTO/X86/attrs.ll diff --git a/test/LTO/bcsection.ll b/test/LTO/X86/bcsection.ll index e65ade6..e65ade6 100644 --- a/test/LTO/bcsection.ll +++ b/test/LTO/X86/bcsection.ll diff --git a/test/LTO/cfi_endproc.ll b/test/LTO/X86/cfi_endproc.ll index a5cc649..1a69bf6 100644 --- a/test/LTO/cfi_endproc.ll +++ b/test/LTO/X86/cfi_endproc.ll @@ -35,3 +35,8 @@ define i32* @get_zed1() { ; ZED1_AND_ZED2: d zed2 @zed2 = linkonce_odr unnamed_addr global i32 42 + +define i32 @useZed2() { + %x = load i32* @zed2 + ret i32 %x +} diff --git a/test/LTO/current-section.ll b/test/LTO/X86/current-section.ll index f79b378..f79b378 100644 --- a/test/LTO/current-section.ll +++ b/test/LTO/X86/current-section.ll diff --git a/test/LTO/diagnostic-handler-remarks.ll b/test/LTO/X86/diagnostic-handler-remarks.ll index 4da9101..4da9101 100644 --- a/test/LTO/diagnostic-handler-remarks.ll +++ b/test/LTO/X86/diagnostic-handler-remarks.ll diff --git a/test/LTO/X86/invalid.ll b/test/LTO/X86/invalid.ll new file mode 100644 index 0000000..5b6996d --- /dev/null +++ b/test/LTO/X86/invalid.ll @@ -0,0 +1,4 @@ +; RUN: not llvm-lto %S/Inputs/invalid.ll.bc 2>&1 | FileCheck %s + + +; CHECK: llvm-lto{{.*}}: error loading file '{{.*}}/Inputs/invalid.ll.bc': Unknown attribute kind (48) diff --git a/test/LTO/jump-table-type.ll b/test/LTO/X86/jump-table-type.ll index a806c30..a806c30 100644 --- a/test/LTO/jump-table-type.ll +++ b/test/LTO/X86/jump-table-type.ll diff --git a/test/LTO/keep-used-puts-during-instcombine.ll b/test/LTO/X86/keep-used-puts-during-instcombine.ll index 69ce3ee..69ce3ee 100644 --- a/test/LTO/keep-used-puts-during-instcombine.ll +++ b/test/LTO/X86/keep-used-puts-during-instcombine.ll diff --git a/test/LTO/linkonce_odr_func.ll b/test/LTO/X86/linkonce_odr_func.ll index a67ffc0..48da795 100644 --- a/test/LTO/linkonce_odr_func.ll +++ b/test/LTO/X86/linkonce_odr_func.ll @@ -29,9 +29,19 @@ define linkonce_odr void @foo4() noinline { ; CHECK: r v1 @v1 = linkonce_odr constant i32 32 +define i32 @useV1() { + %x = load i32* @v1 + ret i32 %x +} + ; CHECK: V v2 @v2 = linkonce_odr global i32 32 +define i32 @useV2() { + %x = load i32* @v2 + ret i32 %x +} + declare void @f(void()*) declare void @p() diff --git a/test/LTO/X86/list-symbols.ll b/test/LTO/X86/list-symbols.ll new file mode 100644 index 0000000..41b7d00 --- /dev/null +++ b/test/LTO/X86/list-symbols.ll @@ -0,0 +1,15 @@ +; RUN: llvm-as -o %T/1.bc %s +; RUN: llvm-as -o %T/2.bc %S/Inputs/list-symbols.ll +; RUN: llvm-lto -list-symbols-only %T/1.bc %T/2.bc | FileCheck %s + +; CHECK-LABEL: 1.bc: +; CHECK-DAG: foo +; CHECK-DAG: glob +; CHECK-LABEL: 2.bc: +; CHECK-DAG: glob +; CHECK-DAG: bar + +@glob = global i32 0 +define void @foo() { + ret void +} diff --git a/test/LTO/lit.local.cfg b/test/LTO/X86/lit.local.cfg index afde89b..afde89b 100644 --- a/test/LTO/lit.local.cfg +++ b/test/LTO/X86/lit.local.cfg diff --git a/test/LTO/no-undefined-puts-when-implemented.ll b/test/LTO/X86/no-undefined-puts-when-implemented.ll index 29db8a6..29db8a6 100644 --- a/test/LTO/no-undefined-puts-when-implemented.ll +++ b/test/LTO/X86/no-undefined-puts-when-implemented.ll diff --git a/test/LTO/private-symbol.ll b/test/LTO/X86/private-symbol.ll index e13a393..e13a393 100644 --- a/test/LTO/private-symbol.ll +++ b/test/LTO/X86/private-symbol.ll diff --git a/test/LTO/runtime-library.ll b/test/LTO/X86/runtime-library.ll index 76fc6f0..76fc6f0 100644 --- a/test/LTO/runtime-library.ll +++ b/test/LTO/X86/runtime-library.ll diff --git a/test/LTO/X86/set-merged.ll b/test/LTO/X86/set-merged.ll new file mode 100644 index 0000000..0e2e1ea --- /dev/null +++ b/test/LTO/X86/set-merged.ll @@ -0,0 +1,36 @@ +; RUN: llvm-as < %s >%t1 +; RUN: llvm-lto -exported-symbol=_main -set-merged-module -o %t2 %t1 +; RUN: llvm-objdump -d %t2 | FileCheck %s + +target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-apple-macosx10.10.0" + +; CHECK: _main +; CHECK: movl $132 +define i32 @_Z3fooi(i32 %a) { +entry: + %a.addr = alloca i32, align 4 + store i32 %a, i32* %a.addr, align 4 + %0 = load i32* %a.addr, align 4 + %1 = load i32* %a.addr, align 4 + %call = call i32 @_Z4bar2i(i32 %1) + %add = add nsw i32 %0, %call + ret i32 %add +} + +define i32 @_Z4bar2i(i32 %a) { +entry: + %a.addr = alloca i32, align 4 + store i32 %a, i32* %a.addr, align 4 + %0 = load i32* %a.addr, align 4 + %mul = mul nsw i32 2, %0 + ret i32 %mul +} + +define i32 @main() { +entry: + %retval = alloca i32, align 4 + store i32 0, i32* %retval + %call = call i32 @_Z3fooi(i32 44) + ret i32 %call +} diff --git a/test/LTO/symver-asm.ll b/test/LTO/X86/symver-asm.ll index 03dda2b..03dda2b 100644 --- a/test/LTO/symver-asm.ll +++ b/test/LTO/X86/symver-asm.ll diff --git a/test/LTO/triple-init.ll b/test/LTO/X86/triple-init.ll index e0ad879..e0ad879 100644 --- a/test/LTO/triple-init.ll +++ b/test/LTO/X86/triple-init.ll |