blob: ed5c6e4fd4f9851e5b6dea7578e7ff2609e03e98 [file] [log] [blame]
Teresa Johnson93f99962018-11-29 17:02:42 +00001; Test handling when two files with the same source file name contain
2; static read only variables with the same name (which will have the same GUID
3; in the combined index).
4
5; Do setup work for all below tests: generate bitcode and combined index
6; RUN: opt -module-summary -module-hash %s -o %t.bc
7; RUN: opt -module-summary -module-hash %p/Inputs/local_name_conflict_var1.ll -o %t2.bc
8; RUN: opt -module-summary -module-hash %p/Inputs/local_name_conflict_var2.ll -o %t3.bc
9; RUN: llvm-lto -thinlto-action=thinlink -o %t4.bc %t.bc %t2.bc %t3.bc
10
11; This module will import a() and b() which should cause the read only copy
12; of baz from each of those modules to be imported. Check that the both are
13; imported as local copies.
14; RUN: llvm-lto -thinlto-action=import -exported-symbol=main %t.bc -thinlto-index=%t4.bc -o - | llvm-dis -o - | FileCheck %s --check-prefix=IMPORT
15; IMPORT: @baz.llvm.{{.*}} = internal global i32 10
16; IMPORT: @baz.llvm.{{.*}} = internal global i32 10
17
18; ModuleID = 'local_name_conflict_var_main.o'
19source_filename = "local_name_conflict_var_main.c"
Amy Huang7b1d7932019-09-10 23:15:38 +000020target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
Teresa Johnson93f99962018-11-29 17:02:42 +000021target triple = "x86_64-unknown-linux-gnu"
22
23; Function Attrs: noinline nounwind uwtable
24define i32 @main() {
25entry:
26 %call1 = call i32 (...) @a()
27 %call2 = call i32 (...) @b()
28 ret i32 0
29}
30
31declare i32 @a(...)
32declare i32 @b(...)