From ba701469a9d579bec3250b8bd47df4d3caf1ea7d Mon Sep 17 00:00:00 2001 From: Adrian Prantl Date: Thu, 4 May 2017 16:26:07 +0000 Subject: [PATCH] Add accidentally deleted testcase back. llvm-svn: 302167 --- llvm/test/Verifier/metadata-function-dbg.ll | 30 +++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 llvm/test/Verifier/metadata-function-dbg.ll diff --git a/llvm/test/Verifier/metadata-function-dbg.ll b/llvm/test/Verifier/metadata-function-dbg.ll new file mode 100644 index 0000000..24989ed --- /dev/null +++ b/llvm/test/Verifier/metadata-function-dbg.ll @@ -0,0 +1,30 @@ +; RUN: not llvm-as %s -disable-output 2>&1 | FileCheck %s + +; CHECK: function declaration may not have a !dbg attachment +declare !dbg !4 void @f1() + +define void @f2() !dbg !4 { + unreachable +} + +; CHECK: function must have a single !dbg attachment +define void @f3() !dbg !4 !dbg !4 { + unreachable +} + +; CHECK-NOT: !dbg +; CHECK: function !dbg attachment must be a subprogram +; CHECK-NEXT: void ()* @bar +; CHECK-NEXT: !{{[0-9]+}} = !{} +define void @bar() !dbg !6 { + unreachable +} + +!llvm.module.flags = !{!0} +!0 = !{i32 2, !"Debug Info Version", i32 3} + +!llvm.dbg.cu = !{!1} +!1 = distinct !DICompileUnit(language: DW_LANG_C99, file: !2) +!2 = !DIFile(filename: "t.c", directory: "/path/to/dir") +!4 = distinct !DISubprogram(name: "foo", scope: !1, file: !2, unit: !1) +!6 = !{} -- 2.7.4