diff options
author | Teresa Johnson <tejohnson@google.com> | 2017-05-23 00:08:00 +0000 |
---|---|---|
committer | Teresa Johnson <tejohnson@google.com> | 2017-05-23 00:08:00 +0000 |
commit | 1fd5bb9c53a36f22f7e97cdd6dbb891a53a20729 (patch) | |
tree | 9b5e09c24f62fa965529e967f5580137d12babac /test/Verifier | |
parent | 6135595faadff2bd15e63f687bddc7f7dd56cc4b (diff) |
Support for taking the max of module flags when linking, use for PIE/PIC
Summary:
Add Max ModFlagBehavior, which can be used to take the max of two
module flag values when merging modules. Use it for the PIE and PIC
levels.
This avoids an error when we try to import from a module built -fpic
into a module built -fPIC, for example. For both PIE and PIC levels,
this will be legal, since the code generation gets more conservative
as the level is increased. Therefore we can take the max instead of
somehow trying to block importing between modules compiled with
different levels.
Reviewers: tmsriram, pcc
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D33418
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303590 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Verifier')
-rw-r--r-- | test/Verifier/module-flags-1.ll | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/test/Verifier/module-flags-1.ll b/test/Verifier/module-flags-1.ll index 36bcb335ffc2..ff82c2845235 100644 --- a/test/Verifier/module-flags-1.ll +++ b/test/Verifier/module-flags-1.ll @@ -41,6 +41,10 @@ ; CHECK-NOT: invalid value for 'append'-type module flag (expected a metadata node) !18 = !{i32 5, !"flag-4", !{i32 57}} +; Check that any 'max' module flags are valid. +; CHECK: invalid value for 'max' module flag (expected constant integer) +!19 = !{i32 7, !"max", !"max"} + ; Check that any 'require' module flags are valid. ; CHECK: invalid requirement on flag, flag is not present in module !11 = !{i32 3, !"bar", !{!"no-such-flag", i32 52}} @@ -54,4 +58,4 @@ !llvm.module.flags = !{ !0, !1, !2, !3, !4, !5, !6, !7, !8, !9, !10, !11, !12, !13, !14, !15, - !16, !17, !18 } + !16, !17, !18, !19 } |