From 1e08165ae9ee3a7b654d9030bc5c86333fe6673f Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Wed, 16 Jan 2013 18:39:23 +0000 Subject: [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 --- test/Linker/module-flags-1-a.ll | 4 ++-- test/Linker/module-flags-3-a.ll | 8 ++++---- test/Linker/module-flags-7-a.ll | 9 +++++++++ test/Linker/module-flags-7-b.ll | 6 ++++++ 4 files changed, 21 insertions(+), 6 deletions(-) create mode 100644 test/Linker/module-flags-7-a.ll create mode 100644 test/Linker/module-flags-7-b.ll (limited to 'test/Linker') 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 } -- cgit v1.1