diff options
author | Steven Wu <stevenwu@apple.com> | 2017-08-21 21:49:13 +0000 |
---|---|---|
committer | Steven Wu <stevenwu@apple.com> | 2017-08-21 21:49:13 +0000 |
commit | 010fc49e42f20d5ae2b9893576fee411f8986685 (patch) | |
tree | 98e57475e84e4f15c8500f092433bfcca48a4ba9 /llvm/test | |
parent | 0d3439a29c60559bb28170c273bfa44e1ff1e335 (diff) | |
download | bcm5719-llvm-010fc49e42f20d5ae2b9893576fee411f8986685.tar.gz bcm5719-llvm-010fc49e42f20d5ae2b9893576fee411f8986685.zip |
[IR] AutoUpgrade ModuleFlagBehavior for PIC and PIE level
Summary:
From r303590, ModuleFlagBehavior for PIC and PIE level is changed from
Error to Max. This will cause bitcode compatibility issue when linking
against a bitcode static archive built with old compiler.
Add an auto-ugprade path to upgrade the the ModuleFlagBehavior in the
old bitcode to match the new one so IRLinker can link them.
Reviewers: tejohnson, mehdi_amini, dexonsmith
Reviewed By: dexonsmith
Subscribers: hans, llvm-commits
Differential Revision: https://reviews.llvm.org/D36556
llvm-svn: 311387
Diffstat (limited to 'llvm/test')
-rw-r--r-- | llvm/test/Bitcode/upgrade-module-flag.ll | 12 | ||||
-rw-r--r-- | llvm/test/Linker/module-flags-pic-1-a.ll | 4 |
2 files changed, 10 insertions, 6 deletions
diff --git a/llvm/test/Bitcode/upgrade-module-flag.ll b/llvm/test/Bitcode/upgrade-module-flag.ll index d6741faa837..de6c9b2cf1b 100644 --- a/llvm/test/Bitcode/upgrade-module-flag.ll +++ b/llvm/test/Bitcode/upgrade-module-flag.ll @@ -1,9 +1,13 @@ ; RUN: llvm-as < %s | llvm-dis | FileCheck %s ; RUN: verify-uselistorder < %s -!llvm.module.flags = !{!0} +!llvm.module.flags = !{!0, !1, !2} -!0 = !{i32 1, !"Objective-C Image Info Version", i32 0} +!0 = !{i32 1, !"PIC Level", i32 1} +!1 = !{i32 1, !"PIE Level", i32 1} +!2 = !{i32 1, !"Objective-C Image Info Version", i32 0} -; CHECK: !0 = !{i32 1, !"Objective-C Image Info Version", i32 0} -; CHECK: !1 = !{i32 4, !"Objective-C Class Properties", i32 0} +; CHECK: !0 = !{i32 7, !"PIC Level", i32 1} +; CHECK: !1 = !{i32 7, !"PIE Level", i32 1} +; CHECK: !2 = !{i32 1, !"Objective-C Image Info Version", i32 0} +; CHECK: !3 = !{i32 4, !"Objective-C Class Properties", i32 0} diff --git a/llvm/test/Linker/module-flags-pic-1-a.ll b/llvm/test/Linker/module-flags-pic-1-a.ll index ea933359ac6..9074aa6e593 100644 --- a/llvm/test/Linker/module-flags-pic-1-a.ll +++ b/llvm/test/Linker/module-flags-pic-1-a.ll @@ -2,8 +2,8 @@ ; test linking modules with specified and default PIC levels -!0 = !{ i32 1, !"PIC Level", i32 1 } +!0 = !{ i32 7, !"PIC Level", i32 1 } !llvm.module.flags = !{!0} ; CHECK: !llvm.module.flags = !{!0} -; CHECK: !0 = !{i32 1, !"PIC Level", i32 1} +; CHECK: !0 = !{i32 7, !"PIC Level", i32 1} |