[LTO] Test lto passes are actually working.

This should have been part of r263761.

llvm-svn: 263763
This commit is contained in:
Davide Italiano 2016-03-17 23:36:31 +00:00
parent 8381c565c3
commit e043c0c68c
2 changed files with 17 additions and 0 deletions

View File

@ -8,6 +8,7 @@ target triple = "x86_64-unknown-linux-gnu"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @ctor, i8* null }]
define void @ctor() {
call void asm "nop", ""()
ret void
}

View File

@ -0,0 +1,16 @@
; REQUIRES: x86
; RUN: rm -f %t %t.lto.bc %t.lto.opt.bc %t.lto.o
; RUN: llvm-as %s -o %t.o
; RUN: ld.lld -m elf_x86_64 %t.o -o %t.so -save-temps -shared
; RUN: llvm-dis %t.so.lto.opt.bc -o - | FileCheck %s
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @ctor, i8* null }]
define void @ctor() {
ret void
}
; `@ctor` doesn't do anything and so the optimizer should kill it, leaving no ctors
; CHECK: @llvm.global_ctors = appending global [0 x { i32, void ()*, i8* }] zeroinitializer