brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.0 KiB · 5803f05 Raw
35 lines · plain
1; ModuleID = 'test.c'2source_filename = "test.c"3target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"4target triple = "x86_64-unknown-linux-gnu"5 6; RUN: opt -module-summary %s -o %t.bc7; RUN: llvm-lto2 run -save-temps %t.bc -o %t.out \8; RUN:    -r=%t.bc,foo,plx \9; RUN:    -r=%t.bc,bar,pl10 11; Check that we don't internalize `bar` during promotion,12; because foo and bar are members of the same comdat13; RUN: llvm-dis %t.out.1.1.promote.bc -o - | FileCheck %s14 15; Thin LTO internalization shouldn't internalize `bar` as well16; RUN: llvm-dis %t.out.1.2.internalize.bc -o - | FileCheck %s17 18; CHECK: define linkonce_odr dso_local i32 @bar() comdat($foo)19 20$foo = comdat any21 22; Function Attrs: noinline nounwind optnone uwtable23define linkonce_odr dso_local i32 @bar() comdat($foo) {24entry:25  ret i32 3326}27 28; Function Attrs: noinline nounwind optnone uwtable29define linkonce_odr dso_local i32 @foo() comdat {30entry:31  %call = call i32 @bar()32  %add = add nsw i32 42, %call33  ret i32 %add34}35