xref: /llvm-project/llvm/test/ThinLTO/X86/builtin-nostrip-aix.ll (revision 8d2e9fc8553c91b1f22e82ffc2c00020f40bb0a2)
1; REQUIRES: powerpc-registered-target
2; Compile with thinlto indices, to enable thinlto.
3; RUN: opt -module-summary %s -o %t1.bc
4
5; Test old lto interface with thinlto.
6; RUN: llvm-lto -exported-symbol=main -thinlto-action=run %t1.bc
7; RUN: llvm-nm %t1.bc | FileCheck %s --check-prefix=CHECK-NM
8
9; Test new lto interface with thinlto.
10; RUN: llvm-lto2 run %t1.bc -o %t.out -save-temps \
11; RUN:   -r %t1.bc,bar,pl \
12; RUN:   -r %t1.bc,__ssp_canary_word,pl \
13; RUN:   -r %t1.bc,__stack_chk_fail,pl
14; RUN: llvm-nm %t.out.1.2.internalize.bc | FileCheck %s --check-prefix=CHECK-NM
15
16; Re-compile, this time without the thinlto indices.
17; RUN: opt %s -o %t4.bc
18
19; Test the new lto interface without thinlto.
20; RUN: llvm-lto2 run %t4.bc -o %t5.out -save-temps \
21; RUN:   -r %t4.bc,bar,pl \
22; RUN:   -r %t4.bc,__ssp_canary_word,pl \
23; RUN:   -r %t4.bc,__stack_chk_fail,pl
24; RUN: llvm-nm %t5.out.0.2.internalize.bc | FileCheck %s --check-prefix=CHECK-NM
25
26; Test the old lto interface without thinlto.
27; RUN: llvm-lto -exported-symbol=main -save-merged-module %t4.bc -o %t6
28; RUN: llvm-nm %t6.merged.bc | FileCheck %s --check-prefix=CHECK-NM
29
30; CHECK-NM: D __ssp_canary_word
31; CHECK-NM: T __stack_chk_fail
32
33target datalayout = "E-m:a-p:32:32-Fi32-i64:64-n32"
34target triple = "powerpc-ibm-aix-xcoff"
35
36define void @bar() {
37    ret void
38}
39
40@__ssp_canary_word = dso_local global i64 1, align 8
41
42define void @__stack_chk_fail() {
43    ret void
44}
45