summaryrefslogtreecommitdiff
path: root/test/Linker/module-flags-4-b.ll
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2012-02-11 11:38:06 +0000
committerBill Wendling <isanbard@gmail.com>2012-02-11 11:38:06 +0000
commitd34cb1e09f5e4b3feb7305346655b83ad2f67773 (patch)
tree3c9b16358ee97a16da10b8eb0ed4e75420ed6b72 /test/Linker/module-flags-4-b.ll
parenta819c397e71adf0fede275ad4abde1947bb21086 (diff)
downloadllvm-d34cb1e09f5e4b3feb7305346655b83ad2f67773.tar.gz
llvm-d34cb1e09f5e4b3feb7305346655b83ad2f67773.tar.bz2
llvm-d34cb1e09f5e4b3feb7305346655b83ad2f67773.tar.xz
[WIP] Initial code for module flags.
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
Diffstat (limited to 'test/Linker/module-flags-4-b.ll')
-rw-r--r--test/Linker/module-flags-4-b.ll8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/Linker/module-flags-4-b.ll b/test/Linker/module-flags-4-b.ll
new file mode 100644
index 0000000000..3a460bbeb0
--- /dev/null
+++ b/test/Linker/module-flags-4-b.ll
@@ -0,0 +1,8 @@
+; This file is used with module-flags-4-a.ll
+; RUN: true
+
+!0 = metadata !{ i32 3, metadata !"foo",
+ metadata !{ metadata !"bar", i32 42 }
+}
+
+!llvm.module.flags = !{ !0 }