diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/Linker/module-flags-8-a.ll | 14 | ||||
-rw-r--r-- | test/Linker/module-flags-8-b.ll | 7 | ||||
-rw-r--r-- | test/Verifier/module-flags-1.ll | 11 |
3 files changed, 31 insertions, 1 deletions
diff --git a/test/Linker/module-flags-8-a.ll b/test/Linker/module-flags-8-a.ll new file mode 100644 index 0000000000..146cae763d --- /dev/null +++ b/test/Linker/module-flags-8-a.ll @@ -0,0 +1,14 @@ +; RUN: llvm-link %s %p/module-flags-8-b.ll -S -o - | sort | FileCheck %s + +; Test append-type module flags. + +; CHECK: !0 = metadata !{i32 5, metadata !"flag-0", metadata !1} +; CHECK: !1 = metadata !{i32 0, i32 0, i32 1} +; CHECK: !2 = metadata !{i32 6, metadata !"flag-1", metadata !3} +; CHECK: !3 = metadata !{i32 0, i32 1, i32 2} +; CHECK: !llvm.module.flags = !{!0, !2} + +!0 = metadata !{ i32 5, metadata !"flag-0", metadata !{ i32 0 } } +!1 = metadata !{ i32 6, metadata !"flag-1", metadata !{ i32 0, i32 1 } } + +!llvm.module.flags = !{ !0, !1 } diff --git a/test/Linker/module-flags-8-b.ll b/test/Linker/module-flags-8-b.ll new file mode 100644 index 0000000000..08f9bc49ee --- /dev/null +++ b/test/Linker/module-flags-8-b.ll @@ -0,0 +1,7 @@ +; This file is used with module-flags-6-a.ll +; RUN: true + +!0 = metadata !{ i32 5, metadata !"flag-0", metadata !{ i32 0, i32 1 } } +!1 = metadata !{ i32 6, metadata !"flag-1", metadata !{ i32 1, i32 2 } } + +!llvm.module.flags = !{ !0, !1 } diff --git a/test/Verifier/module-flags-1.ll b/test/Verifier/module-flags-1.ll index 94e9817115..e5feaf3a58 100644 --- a/test/Verifier/module-flags-1.ll +++ b/test/Verifier/module-flags-1.ll @@ -33,6 +33,14 @@ !9 = metadata !{ i32 2, metadata !"bar", i32 51 } !10 = metadata !{ i32 3, metadata !"bar", metadata !{ metadata !"bar", i32 51 } } +; Check that any 'append'-type module flags are valid. +; CHECK: invalid value for 'append'-type module flag (expected a metadata node) +!16 = metadata !{ i32 5, metadata !"flag-2", i32 56 } +; CHECK: invalid value for 'append'-type module flag (expected a metadata node) +!17 = metadata !{ i32 5, metadata !"flag-3", i32 57 } +; CHECK-NOT: invalid value for 'append'-type module flag (expected a metadata node) +!18 = metadata !{ i32 5, metadata !"flag-4", metadata !{ i32 57 } } + ; Check that any 'require' module flags are valid. ; CHECK: invalid requirement on flag, flag is not present in module !11 = metadata !{ i32 3, metadata !"bar", @@ -48,4 +56,5 @@ metadata !{ metadata !"flag-1", i32 55 } } !llvm.module.flags = !{ - !0, !1, !2, !3, !4, !5, !6, !7, !8, !9, !10, !11, !12, !13, !14, !15 } + !0, !1, !2, !3, !4, !5, !6, !7, !8, !9, !10, !11, !12, !13, !14, !15, + !16, !17, !18 } |