[sanitizer] Improve FreeBSD ASLR detection
[llvm-project.git] / llvm / test / ThinLTO / X86 / linkonce_resolution_comdat.ll
blob7b22180132e6a1dc5fb30e990f0761b81b32f79d
1 ; This test ensures that we drop the preempted copy of @f from %t2.bc from its
2 ; comdat after making it available_externally. If not we would get a
3 ; verification error.
4 ; RUN: opt -module-summary %s -o %t1.bc
5 ; RUN: opt -module-summary %p/Inputs/linkonce_resolution_comdat.ll -o %t2.bc
6 ; RUN: llvm-lto -thinlto-action=run -disable-thinlto-funcattrs=0 %t1.bc %t2.bc -exported-symbol=f -exported-symbol=g -thinlto-save-temps=%t3.
8 ; RUN: llvm-dis %t3.0.3.imported.bc -o - | FileCheck %s --check-prefix=IMPORT1
9 ; RUN: llvm-dis %t3.1.3.imported.bc -o - | FileCheck %s --check-prefix=IMPORT2
10 ; Copy from first module is prevailing and converted to weak_odr, copy
11 ; from second module is preempted and converted to available_externally and
12 ; removed from comdat.
13 ; IMPORT1: define weak_odr i32 @f(i8* %0) unnamed_addr [[ATTR:#[0-9]+]] comdat($c1) {
14 ; IMPORT2: define available_externally i32 @f(i8* %0) unnamed_addr [[ATTR:#[0-9]+]] {
16 ; CHECK-DAG: attributes [[ATTR]] = { norecurse nounwind }
18 ; RUN: llvm-nm -o - < %t1.bc.thinlto.o | FileCheck %s --check-prefix=NM1
19 ; NM1: W f
21 ; RUN: llvm-nm -o - < %t2.bc.thinlto.o | FileCheck %s --check-prefix=NM2
22 ; f() would have been turned into available_externally since it is preempted,
23 ; and inlined into g()
24 ; NM2-NOT: f
26 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
27 target triple = "x86_64-unknown-linux-gnu"
29 $c1 = comdat any
31 define linkonce_odr i32 @f(i8*) unnamed_addr comdat($c1) {
32     ret i32 43