From e954e43b6a94c9de4d45ed796f75e912dbe90a89 Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Wed, 14 Feb 2018 22:41:15 +0000 Subject: [PATCH] [ThinLTO/CFI] Include TYPE_ID summaries into GLOBALVAL_SUMMARY_BLOCK Summary: TypeID summaries are used by CFI and need to be serialized by ThinLTO indexing for later use by LTO Backend. Reviewers: tejohnson, pcc Subscribers: mehdi_amini, inglorion, eraman, hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D42611 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@325182 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CMakeLists.txt | 1 + .../CodeGen/thinlto-distributed-cfi-devirt.ll | 101 ++++++++++++++++++ test/CodeGen/thinlto-distributed-cfi.ll | 67 ++++++++++++ test/CodeGen/thinlto-distributed.ll | 21 ++++ 4 files changed, 190 insertions(+) create mode 100644 test/CodeGen/thinlto-distributed-cfi-devirt.ll create mode 100644 test/CodeGen/thinlto-distributed-cfi.ll create mode 100644 test/CodeGen/thinlto-distributed.ll diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 4b0e94b666..8efe3600c5 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -96,6 +96,7 @@ if( NOT CLANG_BUILT_STANDALONE ) llvm-bcanalyzer llvm-cat llvm-dis + llvm-lto2 llvm-modextract llvm-nm llvm-objdump diff --git a/test/CodeGen/thinlto-distributed-cfi-devirt.ll b/test/CodeGen/thinlto-distributed-cfi-devirt.ll new file mode 100644 index 0000000000..64d454c03f --- /dev/null +++ b/test/CodeGen/thinlto-distributed-cfi-devirt.ll @@ -0,0 +1,101 @@ +; REQUIRES: x86-registered-target + +; Backend test for distribute ThinLTO with CFI. +; It additionally enables -fwhole-program-vtables to get more information in +; TYPE_IDs of GLOBALVAL_SUMMARY_BLOCK. + +; RUN: opt -thinlto-bc -o %t.o %s + +; RUN: llvm-lto2 run -thinlto-distributed-indexes %t.o \ +; RUN: -o %t2.index \ +; RUN: -r=%t.o,test,px \ +; RUN: -r=%t.o,_ZN1A1nEi,p \ +; RUN: -r=%t.o,_ZN1B1fEi,p \ +; RUN: -r=%t.o,_ZN1C1fEi,p \ +; RUN: -r=%t.o,_ZTV1B, \ +; RUN: -r=%t.o,_ZTV1C, \ +; RUN: -r=%t.o,_ZN1A1nEi, \ +; RUN: -r=%t.o,_ZN1B1fEi, \ +; RUN: -r=%t.o,_ZN1C1fEi, \ +; RUN: -r=%t.o,_ZTV1B,px \ +; RUN: -r=%t.o,_ZTV1C,px + +; Ensure that typeids are in the index. +; RUN: llvm-bcanalyzer -dump %t.o.thinlto.bc | FileCheck %s +; CHECK-LABEL: +; CHECK-LABEL: +; CHECK-LABEL: