mirror of
https://github.com/RPCS3/llvm.git
synced 2024-11-28 14:10:55 +00:00
d34cb1e09f
Module flags are key-value pairs associated with the module. They include a 'behavior' value, indicating how module flags react when mergine two files. Normally, it's just the union of the two module flags. But if two module flags have the same key, then the resulting flags are dictated by the behaviors. Allowable behaviors are: Error Emits an error if two values disagree. Warning Emits a warning if two values disagree. Require Emits an error when the specified value is not present or doesn't have the specified value. It is an error for two (or more) llvm.module.flags with the same ID to have the Require behavior but different values. There may be multiple Require flags per ID. Override Uses the specified value if the two values disagree. It is an error for two (or more) llvm.module.flags with the same ID to have the Override behavior but different values. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150300 91177308-0d34-0410-b5e6-96231b3b80d8
17 lines
688 B
LLVM
17 lines
688 B
LLVM
; RUN: llvm-link %s %p/module-flags-1-b.ll -S -o - | sort | FileCheck %s
|
|
|
|
; Test basic functionality of module flags.
|
|
|
|
; CHECK: !0 = metadata !{i32 1, metadata !"foo", i32 37}
|
|
; CHECK: !1 = metadata !{i32 1, metadata !"qux", i32 42}
|
|
; CHECK: !2 = metadata !{i32 1, metadata !"mux", metadata !3}
|
|
; CHECK: !3 = metadata !{metadata !"hello world", i32 927}
|
|
; CHECK: !4 = metadata !{i32 2, metadata !"bar", i32 42}
|
|
; CHECK: !llvm.module.flags = !{!0, !1, !2, !4}
|
|
|
|
!0 = metadata !{ i32 1, metadata !"foo", i32 37 }
|
|
!1 = metadata !{ i32 2, metadata !"bar", i32 42 }
|
|
!2 = metadata !{ i32 1, metadata !"mux", metadata !{ metadata !"hello world", i32 927 } }
|
|
|
|
!llvm.module.flags = !{ !0, !1, !2 }
|