71 lines · plain
1; RUN: llvm-as < %s > %t1.bc2; RUN: llvm-as < %p/Inputs/common2.ll > %t2.bc3 4; Test that the common merging (size + alignment) is properly handled5 6; Client marked the "large with little alignment" one as prevailing7; RUN: llvm-lto2 run %t1.bc %t2.bc -o %t.o -save-temps \8; RUN: -r %t1.bc,v,x \9; RUN: -r %t2.bc,v,px \10; RUN: -r %t1.bc,foo,px \11; RUN: -r %t2.bc,bar,px12; RUN: llvm-dis < %t.o.0.0.preopt.bc | FileCheck %s --check-prefix=LARGE-PREVAILED13 14; Same as before, but reversing the order of the inputs15; RUN: llvm-lto2 run %t2.bc %t1.bc -o %t.o -save-temps \16; RUN: -r %t1.bc,v,x \17; RUN: -r %t2.bc,v,px \18; RUN: -r %t1.bc,foo,px \19; RUN: -r %t2.bc,bar,px20; RUN: llvm-dis < %t.o.0.0.preopt.bc | FileCheck %s --check-prefix=LARGE-PREVAILED21 22; Client marked the "small with large alignment" one as prevailing23; RUN: llvm-lto2 run %t1.bc %t2.bc -o %t.o -save-temps \24; RUN: -r %t1.bc,v,px \25; RUN: -r %t2.bc,v,x \26; RUN: -r %t1.bc,foo,px \27; RUN: -r %t2.bc,bar,px28; RUN: llvm-dis < %t.o.0.0.preopt.bc | FileCheck %s --check-prefix=SMALL-PREVAILED29 30; Same as before, but reversing the order of the inputs31; RUN: llvm-lto2 run %t2.bc %t1.bc -o %t.o -save-temps \32; RUN: -r %t1.bc,v,px \33; RUN: -r %t2.bc,v,x \34; RUN: -r %t1.bc,foo,px \35; RUN: -r %t2.bc,bar,px36; RUN: llvm-dis < %t.o.0.0.preopt.bc | FileCheck %s --check-prefix=SMALL-PREVAILED37 38 39; Client didn't mark any as prevailing, we keep the first one we see as "external"40; RUN: llvm-lto2 run %t1.bc %t2.bc -o %t.o -save-temps \41; RUN: -r %t1.bc,v,x \42; RUN: -r %t2.bc,v,x \43; RUN: -r %t1.bc,foo,px \44; RUN: -r %t2.bc,bar,px45; RUN: llvm-dis < %t.o.0.0.preopt.bc | FileCheck %s --check-prefix=NONE-PREVAILED146 47; Same as before, but reversing the order of the inputs48; RUN: llvm-lto2 run %t2.bc %t1.bc -o %t.o -save-temps \49; RUN: -r %t1.bc,v,x \50; RUN: -r %t2.bc,v,x \51; RUN: -r %t1.bc,foo,px \52; RUN: -r %t2.bc,bar,px53; RUN: llvm-dis < %t.o.0.0.preopt.bc | FileCheck %s --check-prefix=NONE-PREVAILED254 55target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"56target triple = "x86_64-unknown-linux-gnu"57 58@v = common global i8 0, align 859 60; LARGE-PREVAILED: @v = common global i16 0, align 861; SMALL-PREVAILED: @v = common global [2 x i8] zeroinitializer, align 862; BOTH-PREVAILED1: @v = common global i16 0, align 863; BOTH-PREVAILED2: common global [2 x i8] zeroinitializer, align 864; In this case the first is kept as external65; NONE-PREVAILED1: @v = external global i8, align 866; NONE-PREVAILED2: @v = external global i16, align 467 68define ptr @foo() {69 ret ptr @v70}71