2016-08-22 14:25:46 +08:00
|
|
|
; RUN: llvm-as < %s > %t1.bc
|
2016-09-15 05:07:32 +08:00
|
|
|
; RUN: llvm-as < %p/Inputs/common2.ll > %t2.bc
|
2016-08-22 14:25:46 +08:00
|
|
|
|
|
|
|
; Test that the common merging (size + alignment) is properly handled
|
|
|
|
|
|
|
|
; Client marked the "large with little alignment" one as prevailing
|
|
|
|
; RUN: llvm-lto2 %t1.bc %t2.bc -o %t.o -save-temps \
|
|
|
|
; RUN: -r %t1.bc,v,x \
|
|
|
|
; RUN: -r %t2.bc,v,px \
|
|
|
|
; RUN: -r %t1.bc,foo,px \
|
|
|
|
; RUN: -r %t2.bc,bar,px
|
2016-09-01 00:15:39 +08:00
|
|
|
; RUN: llvm-dis < %t.o.0.0.preopt.bc | FileCheck %s --check-prefix=LARGE-PREVAILED
|
2016-08-22 14:25:46 +08:00
|
|
|
|
|
|
|
; Same as before, but reversing the order of the inputs
|
|
|
|
; RUN: llvm-lto2 %t2.bc %t1.bc -o %t.o -save-temps \
|
|
|
|
; RUN: -r %t1.bc,v,x \
|
|
|
|
; RUN: -r %t2.bc,v,px \
|
|
|
|
; RUN: -r %t1.bc,foo,px \
|
|
|
|
; RUN: -r %t2.bc,bar,px
|
2016-09-01 00:15:39 +08:00
|
|
|
; RUN: llvm-dis < %t.o.0.0.preopt.bc | FileCheck %s --check-prefix=LARGE-PREVAILED
|
2016-08-22 14:25:46 +08:00
|
|
|
|
|
|
|
; Client marked the "small with large alignment" one as prevailing
|
|
|
|
; RUN: llvm-lto2 %t1.bc %t2.bc -o %t.o -save-temps \
|
|
|
|
; RUN: -r %t1.bc,v,px \
|
|
|
|
; RUN: -r %t2.bc,v,x \
|
|
|
|
; RUN: -r %t1.bc,foo,px \
|
|
|
|
; RUN: -r %t2.bc,bar,px
|
2016-09-01 00:15:39 +08:00
|
|
|
; RUN: llvm-dis < %t.o.0.0.preopt.bc | FileCheck %s --check-prefix=SMALL-PREVAILED
|
2016-08-22 14:25:46 +08:00
|
|
|
|
|
|
|
; Same as before, but reversing the order of the inputs
|
|
|
|
; RUN: llvm-lto2 %t2.bc %t1.bc -o %t.o -save-temps \
|
|
|
|
; RUN: -r %t1.bc,v,px \
|
|
|
|
; RUN: -r %t2.bc,v,x \
|
|
|
|
; RUN: -r %t1.bc,foo,px \
|
|
|
|
; RUN: -r %t2.bc,bar,px
|
2016-09-01 00:15:39 +08:00
|
|
|
; RUN: llvm-dis < %t.o.0.0.preopt.bc | FileCheck %s --check-prefix=SMALL-PREVAILED
|
2016-08-22 14:25:46 +08:00
|
|
|
|
|
|
|
|
|
|
|
; Client didn't mark any as prevailing, we keep the first one we see as "external"
|
|
|
|
; RUN: llvm-lto2 %t1.bc %t2.bc -o %t.o -save-temps \
|
|
|
|
; RUN: -r %t1.bc,v,x \
|
|
|
|
; RUN: -r %t2.bc,v,x \
|
|
|
|
; RUN: -r %t1.bc,foo,px \
|
|
|
|
; RUN: -r %t2.bc,bar,px
|
2016-09-01 00:15:39 +08:00
|
|
|
; RUN: llvm-dis < %t.o.0.0.preopt.bc | FileCheck %s --check-prefix=NONE-PREVAILED1
|
2016-08-22 14:25:46 +08:00
|
|
|
|
|
|
|
; Same as before, but reversing the order of the inputs
|
|
|
|
; RUN: llvm-lto2 %t2.bc %t1.bc -o %t.o -save-temps \
|
|
|
|
; RUN: -r %t1.bc,v,x \
|
|
|
|
; RUN: -r %t2.bc,v,x \
|
|
|
|
; RUN: -r %t1.bc,foo,px \
|
|
|
|
; RUN: -r %t2.bc,bar,px
|
2016-09-01 00:15:39 +08:00
|
|
|
; RUN: llvm-dis < %t.o.0.0.preopt.bc | FileCheck %s --check-prefix=NONE-PREVAILED2
|
2016-08-22 14:25:46 +08:00
|
|
|
|
2016-09-15 05:05:04 +08:00
|
|
|
|
|
|
|
|
|
|
|
; Client marked both as prevailing
|
|
|
|
; RUN: llvm-lto2 %t1.bc %t2.bc -o %t.o -save-temps \
|
|
|
|
; RUN: -r %t1.bc,v,px \
|
|
|
|
; RUN: -r %t2.bc,v,px \
|
|
|
|
; RUN: -r %t1.bc,foo,px \
|
|
|
|
; RUN: -r %t2.bc,bar,px
|
|
|
|
; RUN: llvm-dis < %t.o.0.0.preopt.bc | FileCheck %s --check-prefix=BOTH-PREVAILED1
|
|
|
|
|
|
|
|
; Same as before, but reversing the order of the inputs
|
|
|
|
; RUN: llvm-lto2 %t2.bc %t1.bc -o %t.o -save-temps \
|
|
|
|
; RUN: -r %t1.bc,v,px \
|
|
|
|
; RUN: -r %t2.bc,v,px \
|
|
|
|
; RUN: -r %t1.bc,foo,px \
|
|
|
|
; RUN: -r %t2.bc,bar,px
|
|
|
|
; RUN: llvm-dis < %t.o.0.0.preopt.bc | FileCheck %s --check-prefix=BOTH-PREVAILED2
|
|
|
|
|
2016-12-15 05:57:04 +08:00
|
|
|
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
|
|
|
|
target triple = "x86_64-unknown-linux-gnu"
|
2016-08-22 14:25:46 +08:00
|
|
|
|
|
|
|
@v = common global i8 0, align 8
|
|
|
|
|
2016-09-01 00:15:39 +08:00
|
|
|
; LARGE-PREVAILED: @v = common global i16 0, align 8
|
|
|
|
; SMALL-PREVAILED: @v = common global [2 x i8] zeroinitializer, align 8
|
2016-09-15 05:05:04 +08:00
|
|
|
; BOTH-PREVAILED1: @v = common global i16 0, align 8
|
|
|
|
; BOTH-PREVAILED2: common global [2 x i8] zeroinitializer, align 8
|
|
|
|
; In this case the first is kept as external
|
|
|
|
; NONE-PREVAILED1: @v = external global i8, align 8
|
|
|
|
; NONE-PREVAILED2: @v = external global i16, align 4
|
2016-08-22 14:25:46 +08:00
|
|
|
|
|
|
|
define i8 *@foo() {
|
|
|
|
ret i8 *@v
|
2016-08-29 20:41:32 +08:00
|
|
|
}
|