| 1 |
; 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 |
; REQUIRES: x86-registered-target |
| 6 |
|
| 7 |
; Do setup work for all below tests: generate bitcode and combined index |
| 8 |
; RUN: opt -module-summary -module-hash %s -o %t.bc |
| 9 |
; RUN: opt -module-summary -module-hash %p/Inputs/thinlto_backend_local_name_conflict1.ll -o %t2.bc |
| 10 |
; RUN: opt -module-summary -module-hash %p/Inputs/thinlto_backend_local_name_conflict2.ll -o %t3.bc |
| 11 |
; RUN: llvm-lto -thinlto-action=thinlink -o %t4.bc %t.bc %t2.bc %t3.bc |
| 12 |
; RUN: llvm-lto -thinlto-action=distributedindexes -exported-symbol=main -thinlto-index=%t4.bc %t.bc |
| 13 |
|
| 14 |
; This module will import a() and b() which should cause the read only copy |
| 15 |
; of baz from each of those modules to be imported. Check that the both are |
| 16 |
; imported as local copies. |
| 17 |
; RUN: %clang -target x86_64-unknown-linux-gnu -O2 -o %t4.o -x ir %t.bc -c -fthinlto-index=%t.bc.thinlto.bc -save-temps=obj |
| 18 |
; RUN: llvm-dis %t.s.3.import.bc -o - | FileCheck --check-prefix=IMPORT %s |
| 19 |
; IMPORT: @baz.llvm.{{.*}} = internal global i32 10 |
| 20 |
; IMPORT: @baz.llvm.{{.*}} = internal global i32 10 |
| 21 |
|
| 22 |
; ModuleID = 'local_name_conflict_var_main.o' |
| 23 |
source_filename = "local_name_conflict_var_main.c" |
| 24 |
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" |
| 25 |
target triple = "x86_64-unknown-linux-gnu" |
| 26 |
|
| 27 |
; Function Attrs: noinline nounwind uwtable |
| 28 |
define i32 @main() { |
| 29 |
entry: |
| 30 |
%call1 = call i32 (...) @a() |
| 31 |
%call2 = call i32 (...) @b() |
| 32 |
ret i32 0 |
| 33 |
} |
| 34 |
|
| 35 |
declare i32 @a(...) |
| 36 |
declare i32 @b(...) |