diff options
author | Daniel Dunbar <daniel@zuster.org> | 2013-01-15 20:52:06 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2013-01-15 20:52:06 +0000 |
commit | 12bfff440700c58bc67e9f9d8f99121632022cf1 (patch) | |
tree | 17318e72f917ccb6b8d579165f15fd00d7f34b0f /test/Verifier | |
parent | 6a459e65c8bd90e8381361379255ebfb9552b5cf (diff) |
[IR] Add verification for module flags with the "require" behavior.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172549 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Verifier')
-rw-r--r-- | test/Verifier/module-flags-1.ll | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/test/Verifier/module-flags-1.ll b/test/Verifier/module-flags-1.ll index eafb1139f2..94e9817115 100644 --- a/test/Verifier/module-flags-1.ll +++ b/test/Verifier/module-flags-1.ll @@ -31,7 +31,21 @@ !8 = metadata !{ i32 2, metadata !"foo", i32 50 } ; CHECK-NOT: module flag identifiers must be unique !9 = metadata !{ i32 2, metadata !"bar", i32 51 } -!10 = metadata !{ i32 3, metadata !"bar", i32 51 } +!10 = metadata !{ i32 3, metadata !"bar", metadata !{ metadata !"bar", i32 51 } } + +; 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", + metadata !{ metadata !"no-such-flag", i32 52 } } +; CHECK: invalid requirement on flag, flag does not have the required value +!12 = metadata !{ i32 1, metadata !"flag-0", i32 53 } +!13 = metadata !{ i32 3, metadata !"bar", + metadata !{ metadata !"flag-0", i32 54 } } +; CHECK-NOT: invalid requirement on flag, flag is not present in module +; CHECK-NOT: invalid requirement on flag, flag does not have the required value +!14 = metadata !{ i32 1, metadata !"flag-1", i32 55 } +!15 = metadata !{ i32 3, metadata !"bar", + metadata !{ metadata !"flag-1", i32 55 } } !llvm.module.flags = !{ - !0, !1, !2, !3, !4, !5, !6, !7, !8, !9, !10 } + !0, !1, !2, !3, !4, !5, !6, !7, !8, !9, !10, !11, !12, !13, !14, !15 } |