diff options
author | Daniel Dunbar <daniel@zuster.org> | 2013-01-16 18:39:23 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2013-01-16 18:39:23 +0000 |
commit | 1e08165ae9ee3a7b654d9030bc5c86333fe6673f (patch) | |
tree | 3d7228687acf7a63846a312083ac6c935ca46720 /test/Linker | |
parent | 75c9b9384f50e9387f24dd7ce6af403cbda6d19a (diff) | |
download | external_llvm-1e08165ae9ee3a7b654d9030bc5c86333fe6673f.zip external_llvm-1e08165ae9ee3a7b654d9030bc5c86333fe6673f.tar.gz external_llvm-1e08165ae9ee3a7b654d9030bc5c86333fe6673f.tar.bz2 |
[Linker] Change module flag linking to be more extensible.
- Instead of computing a bunch of buckets of different flag types, just do an
incremental link resolving conflicts as they arise.
- This also has the advantage of making the link result deterministic and not
dependent on map iteration order.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172634 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Linker')
-rw-r--r-- | test/Linker/module-flags-1-a.ll | 4 | ||||
-rw-r--r-- | test/Linker/module-flags-3-a.ll | 8 | ||||
-rw-r--r-- | test/Linker/module-flags-7-a.ll | 9 | ||||
-rw-r--r-- | test/Linker/module-flags-7-b.ll | 6 |
4 files changed, 21 insertions, 6 deletions
diff --git a/test/Linker/module-flags-1-a.ll b/test/Linker/module-flags-1-a.ll index 973aa80..32f189c 100644 --- a/test/Linker/module-flags-1-a.ll +++ b/test/Linker/module-flags-1-a.ll @@ -3,10 +3,10 @@ ; 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: !1 = metadata !{i32 2, metadata !"bar", 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: !4 = metadata !{i32 1, metadata !"qux", i32 42} ; CHECK: !llvm.module.flags = !{!0, !1, !2, !4} !0 = metadata !{ i32 1, metadata !"foo", i32 37 } diff --git a/test/Linker/module-flags-3-a.ll b/test/Linker/module-flags-3-a.ll index 4233a0a..e7a720e 100644 --- a/test/Linker/module-flags-3-a.ll +++ b/test/Linker/module-flags-3-a.ll @@ -3,10 +3,10 @@ ; Test 'require' behavior. ; CHECK: !0 = metadata !{i32 1, metadata !"foo", i32 37} -; CHECK: !1 = metadata !{i32 3, metadata !"foo", metadata !2} -; CHECK: !2 = metadata !{metadata !"bar", i32 42} -; CHECK: !3 = metadata !{i32 1, metadata !"bar", i32 42} -; CHECK: !llvm.module.flags = !{!0, !1, !3} +; CHECK: !1 = metadata !{i32 1, metadata !"bar", i32 42} +; CHECK: !2 = metadata !{i32 3, metadata !"foo", metadata !3} +; CHECK: !3 = metadata !{metadata !"bar", i32 42} +; CHECK: !llvm.module.flags = !{!0, !1, !2} !0 = metadata !{ i32 1, metadata !"foo", i32 37 } !1 = metadata !{ i32 1, metadata !"bar", i32 42 } diff --git a/test/Linker/module-flags-7-a.ll b/test/Linker/module-flags-7-a.ll new file mode 100644 index 0000000..976c8fe --- /dev/null +++ b/test/Linker/module-flags-7-a.ll @@ -0,0 +1,9 @@ +; RUN: not llvm-link %s %p/module-flags-7-b.ll -S -o - 2>&1 | FileCheck %s + +; Test module flags error messages. + +; CHECK: linking module flags 'foo': IDs have conflicting behaviors + +!0 = metadata !{ i32 1, metadata !"foo", i32 37 } + +!llvm.module.flags = !{ !0 } diff --git a/test/Linker/module-flags-7-b.ll b/test/Linker/module-flags-7-b.ll new file mode 100644 index 0000000..2bc7250 --- /dev/null +++ b/test/Linker/module-flags-7-b.ll @@ -0,0 +1,6 @@ +; This file is used with module-flags-7-a.ll +; RUN: true + +!0 = metadata !{ i32 2, metadata !"foo", i32 37 } + +!llvm.module.flags = !{ !0 } |