mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-02 08:26:29 +00:00
b0011ef93b
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 llvm-svn: 303590
12 lines
335 B
LLVM
12 lines
335 B
LLVM
; RUN: llvm-link %s %p/Inputs/module-flags-pic-2-b.ll -S -o - | FileCheck %s
|
|
|
|
; test linking modules with two different PIC and PIE levels
|
|
|
|
!0 = !{ i32 7, !"PIC Level", i32 1 }
|
|
!1 = !{ i32 7, !"PIE Level", i32 1 }
|
|
|
|
!llvm.module.flags = !{!0, !1}
|
|
|
|
; CHECK: !0 = !{i32 7, !"PIC Level", i32 2}
|
|
; CHECK: !1 = !{i32 7, !"PIE Level", i32 2}
|