1 ; RUN: opt -thinlto-bc -thinlto-split-lto-unit -o %t %s
2 ; RUN: llvm-modextract -b -n 0 -o - %t | llvm-dis | FileCheck --check-prefix=M0 %s
3 ; RUN: llvm-modextract -b -n 1 -o - %t | llvm-dis | FileCheck --check-prefix=M1 %s
5 ; M0: @g = external constant [9 x i8*]{{$}}
6 ; M1: @g = constant [9 x i8*]
7 @g = constant [9 x i8*] [
8 i8* bitcast (i64 (i8*)* @ok1 to i8*),
9 i8* bitcast (i64 (i8*, i64)* @ok2 to i8*),
10 i8* bitcast (void (i8*)* @wrongtype1 to i8*),
11 i8* bitcast (i128 (i8*)* @wrongtype2 to i8*),
12 i8* bitcast (i64 ()* @wrongtype3 to i8*),
13 i8* bitcast (i64 (i8*, i8*)* @wrongtype4 to i8*),
14 i8* bitcast (i64 (i8*, i128)* @wrongtype5 to i8*),
15 i8* bitcast (i64 (i8*)* @usesthis to i8*),
16 i8* bitcast (i8 (i8*)* @reads to i8*)
20 ; M1: define available_externally i64 @ok1
21 define i64 @ok1(i8* %this) {
26 ; M1: define available_externally i64 @ok2
27 define i64 @ok2(i8* %this, i64 %arg) {
28 %1 = tail call { i64, i1 } @llvm.sadd.with.overflow.i64(i64 %arg, i64 %arg)
32 ; M1: declare { i64, i1 } @llvm.sadd.with.overflow.i64(i64, i64)
33 declare { i64, i1 } @llvm.sadd.with.overflow.i64(i64, i64)
35 ; M0: define void @wrongtype1
36 ; M1: declare void @wrongtype1()
37 define void @wrongtype1(i8*) {
41 ; M0: define i128 @wrongtype2
42 ; M1: declare void @wrongtype2()
43 define i128 @wrongtype2(i8*) {
47 ; M0: define i64 @wrongtype3
48 ; M1: declare void @wrongtype3()
49 define i64 @wrongtype3() {
53 ; M0: define i64 @wrongtype4
54 ; M1: declare void @wrongtype4()
55 define i64 @wrongtype4(i8*, i8*) {
59 ; M0: define i64 @wrongtype5
60 ; M1: declare void @wrongtype5()
61 define i64 @wrongtype5(i8*, i128) {
65 ; M0: define i64 @usesthis
66 ; M1: declare void @usesthis()
67 define i64 @usesthis(i8* %this) {
68 %i = ptrtoint i8* %this to i64
72 ; M0: define i8 @reads
73 ; M1: declare void @reads()
74 define i8 @reads(i8* %this) {
75 %l = load i8, i8* %this
79 !0 = !{i32 0, !"typeid"}