88 lines · plain
1; RUN: opt -thinlto-bc -thinlto-split-lto-unit -o %t %s2; RUN: llvm-modextract -b -n 0 -o - %t | llvm-dis | FileCheck --check-prefix=M0 %s3; RUN: llvm-modextract -b -n 1 -o - %t | llvm-dis | FileCheck --check-prefix=M1 %s4 5; M0: @g = external constant [10 x ptr]{{$}}6; M1: @g = constant [10 x ptr]7@g = constant [10 x ptr] [8 ptr @ok1,9 ptr @ok2,10 ptr @wrongtype1,11 ptr @wrongtype2,12 ptr @wrongtype3,13 ptr @wrongtype4,14 ptr @wrongtype5,15 ptr @usesthis,16 ptr @reads,17 ptr @attributedFunc18], !type !019 20; M0: define i64 @ok121; M1: define available_externally i64 @ok122define i64 @ok1(ptr %this) {23 ret i64 4224}25 26; M0: define i64 @ok227; M1: define available_externally i64 @ok228define i64 @ok2(ptr %this, i64 %arg) {29 %1 = tail call { i64, i1 } @llvm.sadd.with.overflow.i64(i64 %arg, i64 %arg)30 ret i64 %arg31}32 33; M1: declare { i64, i1 } @llvm.sadd.with.overflow.i64(i64, i64)34declare { i64, i1 } @llvm.sadd.with.overflow.i64(i64, i64)35 36; M0: define void @wrongtype137; M1: declare void @wrongtype1()38define void @wrongtype1(ptr) {39 ret void40}41 42; M0: define i128 @wrongtype243; M1: declare void @wrongtype2()44define i128 @wrongtype2(ptr) {45 ret i128 046}47 48; M0: define i64 @wrongtype349; M1: declare void @wrongtype3()50define i64 @wrongtype3() {51 ret i64 052}53 54; M0: define i64 @wrongtype455; M1: declare void @wrongtype4()56define i64 @wrongtype4(ptr, ptr) {57 ret i64 058}59 60; M0: define i64 @wrongtype561; M1: declare void @wrongtype5()62define i64 @wrongtype5(ptr, i128) {63 ret i64 064}65 66; M0: define i64 @usesthis67; M1: declare void @usesthis()68define i64 @usesthis(ptr %this) {69 %i = ptrtoint ptr %this to i6470 ret i64 %i71}72 73; M0: define i8 @reads74; M1: declare void @reads()75define i8 @reads(ptr %this) {76 %l = load i8, ptr %this77 ret i8 %l78}79 80; Check function attributes are copied over splitted module81; M0: declare dso_local noundef ptr @attributedFunc(ptr noalias, i8 zeroext) unnamed_addr #[[ATTR0:[0-9]+]]82; M1: declare dso_local void @attributedFunc() unnamed_addr #[[ATTR1:[0-9]+]]83declare dso_local noundef ptr @attributedFunc(ptr noalias, i8 zeroext) unnamed_addr alwaysinline willreturn84; M0: attributes #[[ATTR0]] = { alwaysinline willreturn }85; M1: attributes #[[ATTR1]] = { alwaysinline willreturn }86 87!0 = !{i32 0, !"typeid"}88