+++ /dev/null
-.section .llvmbc,.llvmbc
-.incbin "bcsection.bc"
+++ /dev/null
-.section .llvmbc
-.incbin "bcsection.bc"
+++ /dev/null
-@glob = global i32 0
-define void @bar() {
- ret void
-}
--- /dev/null
+.section .llvmbc,.llvmbc
+.incbin "bcsection.bc"
--- /dev/null
+.section .llvmbc
+.incbin "bcsection.bc"
--- /dev/null
+@glob = global i32 0
+define void @bar() {
+ ret void
+}
--- /dev/null
+; RUN: llvm-as < %s >%t1
+; RUN: llvm-lto -exported-symbol=test_x86_aesni_aeskeygenassist -mattr=+aes -o %t2 %t1
+; RUN: llvm-objdump -d %t2 | FileCheck -check-prefix=WITH_AES %s
+; RUN: not llvm-lto -exported-symbol=test_x86_aesni_aeskeygenassist -mattr=-aes -o %t3 %t1 2>&1 | FileCheck -check-prefix=WITHOUT_AES %s
+
+target triple = "x86_64-unknown-linux-gnu"
+declare <2 x i64> @llvm.x86.aesni.aeskeygenassist(<2 x i64>, i8)
+define <2 x i64> @test_x86_aesni_aeskeygenassist(<2 x i64> %a0) {
+ ; WITH_AES: test_x86_aesni_aeskeygenassist
+ ; WITH_AES: aeskeygenassist
+ %res = call <2 x i64> @llvm.x86.aesni.aeskeygenassist(<2 x i64> %a0, i8 7)
+ ret <2 x i64> %res
+}
+
+; WITHOUT_AES: LLVM ERROR: Cannot select: intrinsic %llvm.x86.aesni.aeskeygenassist
--- /dev/null
+; RUN: llvm-as -o %T/bcsection.bc %s
+
+; RUN: llvm-mc -I=%T -filetype=obj -triple=x86_64-pc-win32 -o %T/bcsection.coff.bco %p/Inputs/bcsection.s
+; RUN: llvm-nm %T/bcsection.coff.bco | FileCheck %s
+; RUN: llvm-lto -exported-symbol=main -exported-symbol=_main -o %T/bcsection.coff.o %T/bcsection.coff.bco
+; RUN: llvm-nm %T/bcsection.coff.o | FileCheck %s
+
+; RUN: llvm-mc -I=%T -filetype=obj -triple=x86_64-unknown-linux-gnu -o %T/bcsection.elf.bco %p/Inputs/bcsection.s
+; RUN: llvm-nm %T/bcsection.elf.bco | FileCheck %s
+; RUN: llvm-lto -exported-symbol=main -exported-symbol=_main -o %T/bcsection.elf.o %T/bcsection.elf.bco
+; RUN: llvm-nm %T/bcsection.elf.o | FileCheck %s
+
+; RUN: llvm-mc -I=%T -filetype=obj -triple=x86_64-apple-darwin11 -o %T/bcsection.macho.bco %p/Inputs/bcsection.macho.s
+; RUN: llvm-nm %T/bcsection.macho.bco | FileCheck %s
+; RUN: llvm-lto -exported-symbol=main -exported-symbol=_main -o %T/bcsection.macho.o %T/bcsection.macho.bco
+; RUN: llvm-nm %T/bcsection.macho.o | FileCheck %s
+
+; CHECK: main
+define i32 @main() {
+ ret i32 0
+}
--- /dev/null
+; RUN: llvm-as < %s >%t1
+; RUN: llvm-lto -o %t2 %t1
+; RUN: llvm-nm %t2 | FileCheck %s -check-prefix=NOEXPORT
+; RUN: llvm-lto -o %t3 -exported-symbol=main %t1
+; RUN: llvm-nm %t3 | FileCheck %s -check-prefix=EXPORT
+
+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 triple = "x86_64-unknown-linux-gnu"
+
+module asm ".text"
+module asm ".align 16, 0x90"
+module asm ".type PR14512, @function"
+module asm "PR14512:.cfi_startproc"
+module asm "ret"
+module asm ".cfi_endproc"
+
+declare void @PR14512()
+
+; Without -exported-symbol, main should be eliminated by LTO.
+; With -exported-symbol=main, main should be preserved by LTO.
+define i32 @main(i32 %argc, i8** %argv) {
+; NOEXPORT-NOT: main
+; EXPORT: main
+ call void @PR14512()
+ ret i32 0
+}
+
+; RUN: llvm-lto -o %t -dso-symbol=zed1 -dso-symbol=zed2 %t1 -disable-opt
+; RUN: llvm-nm %t | FileCheck %s -check-prefix=ZED1_AND_ZED2
+; ZED1_AND_ZED2: V zed1
+@zed1 = linkonce_odr global i32 42
+define i32* @get_zed1() {
+ ret i32* @zed1
+}
+
+; ZED1_AND_ZED2: d zed2
+@zed2 = linkonce_odr unnamed_addr global i32 42
+
+define i32 @useZed2() {
+ %x = load i32* @zed2
+ ret i32 %x
+}
--- /dev/null
+; RUN: llvm-as < %s >%t1
+; RUN: llvm-lto -o %t2 %t1
+
+module asm ".align 4"
--- /dev/null
+; RUN: llvm-as < %s >%t.bc
+; PR21108: Diagnostic handlers get pass remarks, even if they're not enabled.
+
+; Confirm that there are -pass-remarks.
+; RUN: llvm-lto -pass-remarks=inline \
+; RUN: -exported-symbol _main -o %t.o %t.bc 2>&1 | \
+; RUN: FileCheck %s -allow-empty -check-prefix=REMARKS
+; RUN: llvm-nm %t.o | FileCheck %s -check-prefix NM
+
+; RUN: llvm-lto -pass-remarks=inline -use-diagnostic-handler \
+; RUN: -exported-symbol _main -o %t.o %t.bc 2>&1 | \
+; RUN: FileCheck %s -allow-empty -check-prefix=REMARKS
+; RUN: llvm-nm %t.o | FileCheck %s -check-prefix NM
+
+; Confirm that -pass-remarks are not printed by default.
+; RUN: llvm-lto \
+; RUN: -exported-symbol _main -o %t.o %t.bc 2>&1 | \
+; RUN: FileCheck %s -allow-empty
+; RUN: llvm-nm %t.o | FileCheck %s -check-prefix NM
+
+; RUN: llvm-lto -use-diagnostic-handler \
+; RUN: -exported-symbol _main -o %t.o %t.bc 2>&1 | \
+; RUN: FileCheck %s -allow-empty
+; RUN: llvm-nm %t.o | FileCheck %s -check-prefix NM
+
+; REMARKS: remark:
+; CHECK-NOT: remark:
+; NM-NOT: foo
+; NM: main
+
+target triple = "x86_64-apple-darwin"
+
+define i32 @foo() {
+ ret i32 7
+}
+
+define i32 @main() {
+ %i = call i32 @foo()
+ ret i32 %i
+}
--- /dev/null
+; 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)
--- /dev/null
+; RUN: llvm-as <%s >%t1
+; RUN: llvm-lto -o %t2 %t1 -jump-table-type=arity
+; RUN: llvm-nm %t2 | FileCheck %s
+
+; CHECK: t __llvm_jump_instr_table_0_1
+; CHECK: t __llvm_jump_instr_table_1_1
+
+target triple = "x86_64-unknown-linux-gnu"
+
+define i32 @g(i32 %a) unnamed_addr jumptable {
+ ret i32 %a
+}
+
+define i32 @f() unnamed_addr jumptable {
+ ret i32 0
+}
+
+define i32 @main() {
+ ret i32 0
+}
+
+@llvm.used = appending global [2 x i8*] [i8* bitcast (i32(i32)* @g to i8*),
+ i8* bitcast (i32()* @f to i8*)]
--- /dev/null
+; RUN: opt -S -instcombine <%s | FileCheck %s
+; rdar://problem/16165191
+; llvm.compiler.used functions should not be renamed
+
+target triple = "x86_64-apple-darwin11"
+
+@llvm.compiler.used = appending global [1 x i8*] [
+ i8* bitcast (i32(i8*)* @puts to i8*)
+ ], section "llvm.metadata"
+@llvm.used = appending global [1 x i8*] [
+ i8* bitcast (i32(i32)* @uses_printf to i8*)
+ ], section "llvm.metadata"
+
+@str = private unnamed_addr constant [13 x i8] c"hello world\0A\00"
+
+define i32 @uses_printf(i32 %i) {
+entry:
+ %s = getelementptr [13 x i8]* @str, i64 0, i64 0
+ call i32 (i8*, ...)* @printf(i8* %s)
+ ret i32 0
+}
+
+define internal i32 @printf(i8* readonly nocapture %fmt, ...) {
+entry:
+ %ret = call i32 @bar(i8* %fmt)
+ ret i32 %ret
+}
+
+; CHECK: define {{.*}} @puts(
+define internal i32 @puts(i8* %s) {
+entry:
+ %ret = call i32 @bar(i8* %s)
+ ret i32 %ret
+}
+
+declare i32 @bar(i8*)
--- /dev/null
+; RUN: llvm-as < %s >%t1
+; RUN: llvm-lto -o %t2 -dso-symbol=foo1 -dso-symbol=foo2 -dso-symbol=foo3 \
+; RUN: -dso-symbol=foo4 -dso-symbol=v1 -dso-symbol=v2 %t1 -disable-opt
+; 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 triple = "x86_64-unknown-linux-gnu"
+
+; CHECK: t foo1
+define linkonce_odr void @foo1() noinline {
+ ret void
+}
+
+; CHECK: W foo2
+define linkonce_odr void @foo2() noinline {
+ ret void
+}
+
+; CHECK: t foo3
+define linkonce_odr void @foo3() noinline {
+ ret void
+}
+
+; CHECK: W foo4
+define linkonce_odr void @foo4() noinline {
+ ret void
+}
+
+; 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()
+
+define void @bar() {
+bb0:
+ call void @foo1()
+ call void @f(void()* @foo2)
+ invoke void @foo3() to label %bb1 unwind label %clean
+bb1:
+ invoke void @f(void()* @foo4) to label %bb2 unwind label %clean
+bb2:
+ ret void
+clean:
+ landingpad {i32, i32} personality void()* @p cleanup
+ ret void
+}
--- /dev/null
+; 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
+}
--- /dev/null
+if not 'X86' in config.root.targets:
+ config.unsupported = True
--- /dev/null
+; RUN: llvm-as <%s >%t1
+; RUN: llvm-lto -exported-symbol=_uses_puts -exported-symbol=_uses_printf -o - %t1 | \
+; RUN: llvm-nm - | \
+; RUN: FileCheck %s
+; rdar://problem/16165191
+; runtime library implementations should not be renamed
+
+target triple = "x86_64-apple-darwin11"
+
+@str = private unnamed_addr constant [13 x i8] c"hello world\0A\00"
+
+; CHECK-NOT: U _puts
+; CHECK: T _uses_printf
+; CHECK: T _uses_puts
+define i32 @uses_puts(i32 %i) {
+entry:
+ %s = call i8* @foo(i32 %i)
+ %ret = call i32 @puts(i8* %s)
+ ret i32 %ret
+}
+define i32 @uses_printf(i32 %i) {
+entry:
+ %s = getelementptr [13 x i8]* @str, i64 0, i64 0
+ call i32 (i8*, ...)* @printf(i8* %s)
+ ret i32 0
+}
+
+define hidden i32 @printf(i8* readonly nocapture %fmt, ...) {
+entry:
+ %ret = call i32 @bar(i8* %fmt)
+ ret i32 %ret
+}
+define hidden i32 @puts(i8* %s) {
+entry:
+ %ret = call i32 @bar(i8* %s)
+ ret i32 %ret
+}
+
+declare i8* @foo(i32)
+declare i32 @bar(i8*)
--- /dev/null
+; RUN: llvm-as < %s >%t1
+; RUN: llvm-lto -o %t2 %t1
+
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-unknown-linux-gnu"
+
+@.str = private unnamed_addr constant [7 x i8] c"hello\0A\00", align 1
--- /dev/null
+; runtime library implementations should be added to llvm.compiler.used
+; RUN: llvm-as <%s >%t1
+; RUN: llvm-lto -o %t2 %t1
+; RUN: llvm-nm -no-sort %t2 | FileCheck %s -check-prefix=KEEP -check-prefix=LOSE
+
+target triple = "x86_64-apple-darwin9"
+
+; KEEP-LABEL: _puts
+define void @puts() {
+ ret void
+}
+
+; KEEP-LABEL: ___divti3
+define void @__divti3() {
+ ret void
+}
+
+; KEEP-LABEL: _memset
+define void @memset() {
+ ret void
+}
+
+; LOSE-NOT: _myprintf
+define void @myprintf() {
+ ret void
+}
+
--- /dev/null
+; RUN: llvm-as < %s >%t1
+; RUN: llvm-lto -o %t2 %t1
+; RUN: llvm-nm %t2 | FileCheck %s
+
+target triple = "x86_64-unknown-linux-gnu"
+
+module asm ".symver io_cancel_0_4,io_cancel@@LIBAIO_0.4"
+
+; Even without -exported-symbol, io_cancel_0_4 should be noticed by LTOModule's
+; RecordStreamer, so it shouldn't get eliminated. However, the object file will
+; contain the aliased symver as well as the original.
+define i32 @io_cancel_0_4() {
+; CHECK: io_cancel@@LIBAIO_0.4
+; CHECK: io_cancel_0_4
+ ret i32 0
+}
--- /dev/null
+; RUN: llvm-as < %s >%t1
+; 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 triple = "x86_64-apple-macosx10.9"
+
+declare double @pow(double, double)
+
+define double @main(double %x) {
+; We check that LTO will be aware of target triple and apply pow to __exp10 transformation.
+; CHECK: U ___exp10
+ %retval = call double @pow(double 10.0, double %x)
+ ret double %retval
+}
+++ /dev/null
-; RUN: llvm-as < %s >%t1
-; RUN: llvm-lto -exported-symbol=test_x86_aesni_aeskeygenassist -mattr=+aes -o %t2 %t1
-; RUN: llvm-objdump -d %t2 | FileCheck -check-prefix=WITH_AES %s
-; RUN: not llvm-lto -exported-symbol=test_x86_aesni_aeskeygenassist -mattr=-aes -o %t3 %t1 2>&1 | FileCheck -check-prefix=WITHOUT_AES %s
-
-target triple = "x86_64-unknown-linux-gnu"
-declare <2 x i64> @llvm.x86.aesni.aeskeygenassist(<2 x i64>, i8)
-define <2 x i64> @test_x86_aesni_aeskeygenassist(<2 x i64> %a0) {
- ; WITH_AES: test_x86_aesni_aeskeygenassist
- ; WITH_AES: aeskeygenassist
- %res = call <2 x i64> @llvm.x86.aesni.aeskeygenassist(<2 x i64> %a0, i8 7)
- ret <2 x i64> %res
-}
-
-; WITHOUT_AES: LLVM ERROR: Cannot select: intrinsic %llvm.x86.aesni.aeskeygenassist
+++ /dev/null
-; RUN: llvm-as -o %T/bcsection.bc %s
-
-; RUN: llvm-mc -I=%T -filetype=obj -triple=x86_64-pc-win32 -o %T/bcsection.coff.bco %p/Inputs/bcsection.s
-; RUN: llvm-nm %T/bcsection.coff.bco | FileCheck %s
-; RUN: llvm-lto -exported-symbol=main -exported-symbol=_main -o %T/bcsection.coff.o %T/bcsection.coff.bco
-; RUN: llvm-nm %T/bcsection.coff.o | FileCheck %s
-
-; RUN: llvm-mc -I=%T -filetype=obj -triple=x86_64-unknown-linux-gnu -o %T/bcsection.elf.bco %p/Inputs/bcsection.s
-; RUN: llvm-nm %T/bcsection.elf.bco | FileCheck %s
-; RUN: llvm-lto -exported-symbol=main -exported-symbol=_main -o %T/bcsection.elf.o %T/bcsection.elf.bco
-; RUN: llvm-nm %T/bcsection.elf.o | FileCheck %s
-
-; RUN: llvm-mc -I=%T -filetype=obj -triple=x86_64-apple-darwin11 -o %T/bcsection.macho.bco %p/Inputs/bcsection.macho.s
-; RUN: llvm-nm %T/bcsection.macho.bco | FileCheck %s
-; RUN: llvm-lto -exported-symbol=main -exported-symbol=_main -o %T/bcsection.macho.o %T/bcsection.macho.bco
-; RUN: llvm-nm %T/bcsection.macho.o | FileCheck %s
-
-; CHECK: main
-define i32 @main() {
- ret i32 0
-}
+++ /dev/null
-; RUN: llvm-as < %s >%t1
-; RUN: llvm-lto -o %t2 %t1
-; RUN: llvm-nm %t2 | FileCheck %s -check-prefix=NOEXPORT
-; RUN: llvm-lto -o %t3 -exported-symbol=main %t1
-; RUN: llvm-nm %t3 | FileCheck %s -check-prefix=EXPORT
-
-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 triple = "x86_64-unknown-linux-gnu"
-
-module asm ".text"
-module asm ".align 16, 0x90"
-module asm ".type PR14512, @function"
-module asm "PR14512:.cfi_startproc"
-module asm "ret"
-module asm ".cfi_endproc"
-
-declare void @PR14512()
-
-; Without -exported-symbol, main should be eliminated by LTO.
-; With -exported-symbol=main, main should be preserved by LTO.
-define i32 @main(i32 %argc, i8** %argv) {
-; NOEXPORT-NOT: main
-; EXPORT: main
- call void @PR14512()
- ret i32 0
-}
-
-; RUN: llvm-lto -o %t -dso-symbol=zed1 -dso-symbol=zed2 %t1 -disable-opt
-; RUN: llvm-nm %t | FileCheck %s -check-prefix=ZED1_AND_ZED2
-; ZED1_AND_ZED2: V zed1
-@zed1 = linkonce_odr global i32 42
-define i32* @get_zed1() {
- ret i32* @zed1
-}
-
-; ZED1_AND_ZED2: d zed2
-@zed2 = linkonce_odr unnamed_addr global i32 42
-
-define i32 @useZed2() {
- %x = load i32* @zed2
- ret i32 %x
-}
+++ /dev/null
-; RUN: llvm-as < %s >%t1
-; RUN: llvm-lto -o %t2 %t1
-
-module asm ".align 4"
+++ /dev/null
-; RUN: llvm-as < %s >%t.bc
-; PR21108: Diagnostic handlers get pass remarks, even if they're not enabled.
-
-; Confirm that there are -pass-remarks.
-; RUN: llvm-lto -pass-remarks=inline \
-; RUN: -exported-symbol _main -o %t.o %t.bc 2>&1 | \
-; RUN: FileCheck %s -allow-empty -check-prefix=REMARKS
-; RUN: llvm-nm %t.o | FileCheck %s -check-prefix NM
-
-; RUN: llvm-lto -pass-remarks=inline -use-diagnostic-handler \
-; RUN: -exported-symbol _main -o %t.o %t.bc 2>&1 | \
-; RUN: FileCheck %s -allow-empty -check-prefix=REMARKS
-; RUN: llvm-nm %t.o | FileCheck %s -check-prefix NM
-
-; Confirm that -pass-remarks are not printed by default.
-; RUN: llvm-lto \
-; RUN: -exported-symbol _main -o %t.o %t.bc 2>&1 | \
-; RUN: FileCheck %s -allow-empty
-; RUN: llvm-nm %t.o | FileCheck %s -check-prefix NM
-
-; RUN: llvm-lto -use-diagnostic-handler \
-; RUN: -exported-symbol _main -o %t.o %t.bc 2>&1 | \
-; RUN: FileCheck %s -allow-empty
-; RUN: llvm-nm %t.o | FileCheck %s -check-prefix NM
-
-; REMARKS: remark:
-; CHECK-NOT: remark:
-; NM-NOT: foo
-; NM: main
-
-target triple = "x86_64-apple-darwin"
-
-define i32 @foo() {
- ret i32 7
-}
-
-define i32 @main() {
- %i = call i32 @foo()
- ret i32 %i
-}
+++ /dev/null
-; 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)
+++ /dev/null
-; RUN: llvm-as <%s >%t1
-; RUN: llvm-lto -o %t2 %t1 -jump-table-type=arity
-; RUN: llvm-nm %t2 | FileCheck %s
-
-; CHECK: t __llvm_jump_instr_table_0_1
-; CHECK: t __llvm_jump_instr_table_1_1
-
-target triple = "x86_64-unknown-linux-gnu"
-
-define i32 @g(i32 %a) unnamed_addr jumptable {
- ret i32 %a
-}
-
-define i32 @f() unnamed_addr jumptable {
- ret i32 0
-}
-
-define i32 @main() {
- ret i32 0
-}
-
-@llvm.used = appending global [2 x i8*] [i8* bitcast (i32(i32)* @g to i8*),
- i8* bitcast (i32()* @f to i8*)]
+++ /dev/null
-; RUN: opt -S -instcombine <%s | FileCheck %s
-; rdar://problem/16165191
-; llvm.compiler.used functions should not be renamed
-
-target triple = "x86_64-apple-darwin11"
-
-@llvm.compiler.used = appending global [1 x i8*] [
- i8* bitcast (i32(i8*)* @puts to i8*)
- ], section "llvm.metadata"
-@llvm.used = appending global [1 x i8*] [
- i8* bitcast (i32(i32)* @uses_printf to i8*)
- ], section "llvm.metadata"
-
-@str = private unnamed_addr constant [13 x i8] c"hello world\0A\00"
-
-define i32 @uses_printf(i32 %i) {
-entry:
- %s = getelementptr [13 x i8]* @str, i64 0, i64 0
- call i32 (i8*, ...)* @printf(i8* %s)
- ret i32 0
-}
-
-define internal i32 @printf(i8* readonly nocapture %fmt, ...) {
-entry:
- %ret = call i32 @bar(i8* %fmt)
- ret i32 %ret
-}
-
-; CHECK: define {{.*}} @puts(
-define internal i32 @puts(i8* %s) {
-entry:
- %ret = call i32 @bar(i8* %s)
- ret i32 %ret
-}
-
-declare i32 @bar(i8*)
+++ /dev/null
-; RUN: llvm-as < %s >%t1
-; RUN: llvm-lto -o %t2 -dso-symbol=foo1 -dso-symbol=foo2 -dso-symbol=foo3 \
-; RUN: -dso-symbol=foo4 -dso-symbol=v1 -dso-symbol=v2 %t1 -disable-opt
-; 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 triple = "x86_64-unknown-linux-gnu"
-
-; CHECK: t foo1
-define linkonce_odr void @foo1() noinline {
- ret void
-}
-
-; CHECK: W foo2
-define linkonce_odr void @foo2() noinline {
- ret void
-}
-
-; CHECK: t foo3
-define linkonce_odr void @foo3() noinline {
- ret void
-}
-
-; CHECK: W foo4
-define linkonce_odr void @foo4() noinline {
- ret void
-}
-
-; 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()
-
-define void @bar() {
-bb0:
- call void @foo1()
- call void @f(void()* @foo2)
- invoke void @foo3() to label %bb1 unwind label %clean
-bb1:
- invoke void @f(void()* @foo4) to label %bb2 unwind label %clean
-bb2:
- ret void
-clean:
- landingpad {i32, i32} personality void()* @p cleanup
- ret void
-}
+++ /dev/null
-; 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
-}
+++ /dev/null
-if not 'X86' in config.root.targets:
- config.unsupported = True
+++ /dev/null
-; RUN: llvm-as <%s >%t1
-; RUN: llvm-lto -exported-symbol=_uses_puts -exported-symbol=_uses_printf -o - %t1 | \
-; RUN: llvm-nm - | \
-; RUN: FileCheck %s
-; rdar://problem/16165191
-; runtime library implementations should not be renamed
-
-target triple = "x86_64-apple-darwin11"
-
-@str = private unnamed_addr constant [13 x i8] c"hello world\0A\00"
-
-; CHECK-NOT: U _puts
-; CHECK: T _uses_printf
-; CHECK: T _uses_puts
-define i32 @uses_puts(i32 %i) {
-entry:
- %s = call i8* @foo(i32 %i)
- %ret = call i32 @puts(i8* %s)
- ret i32 %ret
-}
-define i32 @uses_printf(i32 %i) {
-entry:
- %s = getelementptr [13 x i8]* @str, i64 0, i64 0
- call i32 (i8*, ...)* @printf(i8* %s)
- ret i32 0
-}
-
-define hidden i32 @printf(i8* readonly nocapture %fmt, ...) {
-entry:
- %ret = call i32 @bar(i8* %fmt)
- ret i32 %ret
-}
-define hidden i32 @puts(i8* %s) {
-entry:
- %ret = call i32 @bar(i8* %s)
- ret i32 %ret
-}
-
-declare i8* @foo(i32)
-declare i32 @bar(i8*)
+++ /dev/null
-; RUN: llvm-as < %s >%t1
-; RUN: llvm-lto -o %t2 %t1
-
-target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
-target triple = "x86_64-unknown-linux-gnu"
-
-@.str = private unnamed_addr constant [7 x i8] c"hello\0A\00", align 1
+++ /dev/null
-; runtime library implementations should be added to llvm.compiler.used
-; RUN: llvm-as <%s >%t1
-; RUN: llvm-lto -o %t2 %t1
-; RUN: llvm-nm -no-sort %t2 | FileCheck %s -check-prefix=KEEP -check-prefix=LOSE
-
-target triple = "x86_64-apple-darwin9"
-
-; KEEP-LABEL: _puts
-define void @puts() {
- ret void
-}
-
-; KEEP-LABEL: ___divti3
-define void @__divti3() {
- ret void
-}
-
-; KEEP-LABEL: _memset
-define void @memset() {
- ret void
-}
-
-; LOSE-NOT: _myprintf
-define void @myprintf() {
- ret void
-}
-
+++ /dev/null
-; RUN: llvm-as < %s >%t1
-; RUN: llvm-lto -o %t2 %t1
-; RUN: llvm-nm %t2 | FileCheck %s
-
-target triple = "x86_64-unknown-linux-gnu"
-
-module asm ".symver io_cancel_0_4,io_cancel@@LIBAIO_0.4"
-
-; Even without -exported-symbol, io_cancel_0_4 should be noticed by LTOModule's
-; RecordStreamer, so it shouldn't get eliminated. However, the object file will
-; contain the aliased symver as well as the original.
-define i32 @io_cancel_0_4() {
-; CHECK: io_cancel@@LIBAIO_0.4
-; CHECK: io_cancel_0_4
- ret i32 0
-}
+++ /dev/null
-; RUN: llvm-as < %s >%t1
-; 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 triple = "x86_64-apple-macosx10.9"
-
-declare double @pow(double, double)
-
-define double @main(double %x) {
-; We check that LTO will be aware of target triple and apply pow to __exp10 transformation.
-; CHECK: U ___exp10
- %retval = call double @pow(double 10.0, double %x)
- ret double %retval
-}