summaryrefslogtreecommitdiffstats
path: root/llvm/test/Verifier/llvm.dbg.value-expression.ll
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-03-15 01:21:30 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-03-15 01:21:30 +0000
commit166121ad0bd0c6adc83e0ff5e41bfd3d89500369 (patch)
treeed0c6240ff3f5378e3a69fe61a6daffe58237a0c /llvm/test/Verifier/llvm.dbg.value-expression.ll
parentad80af8f191503fe33deecf8efc57ff2878aa3d1 (diff)
downloadbcm5719-llvm-166121ad0bd0c6adc83e0ff5e41bfd3d89500369.tar.gz
bcm5719-llvm-166121ad0bd0c6adc83e0ff5e41bfd3d89500369.zip
Verifier: Check debug info intrinsic arguments
Verify that debug info intrinsic arguments are valid. (These checks will not recurse through the full debug info graph, so they don't need to be cordoned of in `DebugInfoVerifier`.) With those checks in place, changing the `DbgIntrinsicInst` accessors to downcast to `MDLocalVariable` and `MDExpression` is natural (added isa specializations in `Metadata.h` to support this). Added tests to `test/Verifier` for the new -verify checks, and fixed the debug info in all the in-tree tests. If you have out-of-tree testcases that have started to fail to -verify, hopefully the verify checks are helpful. The most likely problem is that the expression argument is `!{}` (instead of `!MDExpression()`). llvm-svn: 232296
Diffstat (limited to 'llvm/test/Verifier/llvm.dbg.value-expression.ll')
-rw-r--r--llvm/test/Verifier/llvm.dbg.value-expression.ll16
1 files changed, 16 insertions, 0 deletions
diff --git a/llvm/test/Verifier/llvm.dbg.value-expression.ll b/llvm/test/Verifier/llvm.dbg.value-expression.ll
new file mode 100644
index 00000000000..c0d14a5a2c2
--- /dev/null
+++ b/llvm/test/Verifier/llvm.dbg.value-expression.ll
@@ -0,0 +1,16 @@
+; RUN: not llvm-as -disable-output <%s 2>&1 | FileCheck %s
+; CHECK: invalid llvm.dbg.value intrinsic expression
+; CHECK-NEXT: call void @llvm.dbg.value({{.*}})
+; CHECK-NEXT: !""
+
+define void @foo(i32 %a) {
+entry:
+ %s = alloca i32
+ call void @llvm.dbg.value(metadata i32* %s, i64 0, metadata !MDLocalVariable(tag: DW_TAG_arg_variable), metadata !"")
+ ret void
+}
+
+declare void @llvm.dbg.value(metadata, i64, metadata, metadata)
+
+!llvm.module.flags = !{!0}
+!0 = !{i32 2, !"Debug Info Version", i32 3}
OpenPOWER on IntegriCloud