diff options
| author | Peter Collingbourne <peter@pcc.me.uk> | 2017-02-14 03:42:38 +0000 |
|---|---|---|
| committer | Peter Collingbourne <peter@pcc.me.uk> | 2017-02-14 03:42:38 +0000 |
| commit | 002c2d538021f7cf94180ec19f4bd86a474e2a4a (patch) | |
| tree | 8d26f4f00055a0dced9b206d2d10f551451e1478 /llvm/test | |
| parent | eb7702e07d1d924752bd41e707a66e9a755297fc (diff) | |
| download | bcm5719-llvm-002c2d538021f7cf94180ec19f4bd86a474e2a4a.tar.gz bcm5719-llvm-002c2d538021f7cf94180ec19f4bd86a474e2a4a.zip | |
ThinLTOBitcodeWriter: Write available_externally copies of VCP eligible functions to merged module.
Differential Revision: https://reviews.llvm.org/D29701
llvm-svn: 295021
Diffstat (limited to 'llvm/test')
| -rw-r--r-- | llvm/test/Transforms/ThinLTOBitcodeWriter/split-vfunc-internal.ll | 21 | ||||
| -rw-r--r-- | llvm/test/Transforms/ThinLTOBitcodeWriter/split-vfunc.ll | 75 |
2 files changed, 96 insertions, 0 deletions
diff --git a/llvm/test/Transforms/ThinLTOBitcodeWriter/split-vfunc-internal.ll b/llvm/test/Transforms/ThinLTOBitcodeWriter/split-vfunc-internal.ll new file mode 100644 index 00000000000..087796b5031 --- /dev/null +++ b/llvm/test/Transforms/ThinLTOBitcodeWriter/split-vfunc-internal.ll @@ -0,0 +1,21 @@ +; RUN: opt -thinlto-bc -o %t %s +; RUN: llvm-modextract -b -n 0 -o - %t | llvm-dis | FileCheck --check-prefix=M0 %s +; RUN: llvm-modextract -b -n 1 -o - %t | llvm-dis | FileCheck --check-prefix=M1 %s + +define [1 x i8*]* @source() { + ret [1 x i8*]* @g +} + +; M0: @"g$84f59439b469192440047efc8de357fb" = external hidden constant [1 x i8*]{{$}} +; M1: @"g$84f59439b469192440047efc8de357fb" = hidden constant [1 x i8*] [i8* bitcast (i64 (i8*)* @"ok$84f59439b469192440047efc8de357fb" to i8*)] +@g = internal constant [1 x i8*] [ + i8* bitcast (i64 (i8*)* @ok to i8*) +], !type !0 + +; M0: define hidden i64 @"ok$84f59439b469192440047efc8de357fb" +; M1: define available_externally hidden i64 @"ok$84f59439b469192440047efc8de357fb" +define internal i64 @ok(i8* %this) { + ret i64 42 +} + +!0 = !{i32 0, !"typeid"} diff --git a/llvm/test/Transforms/ThinLTOBitcodeWriter/split-vfunc.ll b/llvm/test/Transforms/ThinLTOBitcodeWriter/split-vfunc.ll new file mode 100644 index 00000000000..0793459af41 --- /dev/null +++ b/llvm/test/Transforms/ThinLTOBitcodeWriter/split-vfunc.ll @@ -0,0 +1,75 @@ +; RUN: opt -thinlto-bc -o %t %s +; RUN: llvm-modextract -b -n 0 -o - %t | llvm-dis | FileCheck --check-prefix=M0 %s +; RUN: llvm-modextract -b -n 1 -o - %t | llvm-dis | FileCheck --check-prefix=M1 %s + +; M0: @g = external constant [9 x i8*]{{$}} +; M1: @g = constant [9 x i8*] +@g = constant [9 x i8*] [ + i8* bitcast (i64 (i8*)* @ok1 to i8*), + i8* bitcast (i64 (i8*, i64)* @ok2 to i8*), + i8* bitcast (void (i8*)* @wrongtype1 to i8*), + i8* bitcast (i128 (i8*)* @wrongtype2 to i8*), + i8* bitcast (i64 ()* @wrongtype3 to i8*), + i8* bitcast (i64 (i8*, i8*)* @wrongtype4 to i8*), + i8* bitcast (i64 (i8*, i128)* @wrongtype5 to i8*), + i8* bitcast (i64 (i8*)* @usesthis to i8*), + i8* bitcast (i8 (i8*)* @reads to i8*) +], !type !0 + +; M0: define i64 @ok1 +; M1: define available_externally i64 @ok1 +define i64 @ok1(i8* %this) { + ret i64 42 +} + +; M0: define i64 @ok2 +; M1: define available_externally i64 @ok2 +define i64 @ok2(i8* %this, i64 %arg) { + ret i64 %arg +} + +; M0: define void @wrongtype1 +; M1: declare void @wrongtype1() +define void @wrongtype1(i8*) { + ret void +} + +; M0: define i128 @wrongtype2 +; M1: declare void @wrongtype2() +define i128 @wrongtype2(i8*) { + ret i128 0 +} + +; M0: define i64 @wrongtype3 +; M1: declare void @wrongtype3() +define i64 @wrongtype3() { + ret i64 0 +} + +; M0: define i64 @wrongtype4 +; M1: declare void @wrongtype4() +define i64 @wrongtype4(i8*, i8*) { + ret i64 0 +} + +; M0: define i64 @wrongtype5 +; M1: declare void @wrongtype5() +define i64 @wrongtype5(i8*, i128) { + ret i64 0 +} + +; M0: define i64 @usesthis +; M1: declare void @usesthis() +define i64 @usesthis(i8* %this) { + %i = ptrtoint i8* %this to i64 + ret i64 %i +} + +; M0: define i8 @reads +; M1: declare void @reads() +define i8 @reads(i8* %this) { + %l = load i8, i8* %this + ret i8 %l +} + +!0 = !{i32 0, !"typeid"} |

