summaryrefslogtreecommitdiffstats
path: root/llvm/test/DebugInfo/Generic
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2017-10-02 18:31:29 +0000
committerAdrian Prantl <aprantl@apple.com>2017-10-02 18:31:29 +0000
commita8b2ddbde453fab0db90be21b9a1ff961a7770e0 (patch)
tree190712a839a2ce48d61e75501d2f68440891a2d8 /llvm/test/DebugInfo/Generic
parent6e17c00a88e23d0cc4cb491bfd0830f3df7fff66 (diff)
downloadbcm5719-llvm-a8b2ddbde453fab0db90be21b9a1ff961a7770e0.tar.gz
bcm5719-llvm-a8b2ddbde453fab0db90be21b9a1ff961a7770e0.zip
Move the stripping of invalid debug info from the Verifier to AutoUpgrade.
This came out of a recent discussion on llvm-dev (https://reviews.llvm.org/D38042). Currently the Verifier will strip the debug info metadata from a module if it finds the dbeug info to be malformed. This feature is very valuable since it allows us to improve the Verifier by making it stricter without breaking bcompatibility, but arguable the Verifier pass should not be modifying the IR. This patch moves the stripping of broken debug info into AutoUpgrade (UpgradeDebugInfo to be precise), which is a much better location for this since the stripping of malformed (i.e., produced by older, buggy versions of Clang) is a (harsh) form of AutoUpgrade. This change is mostly NFC in nature, the one big difference is the behavior when LLVM module passes are introducing malformed debug info. Prior to this patch, a NoAsserts build would have printed a warning and stripped the debug info, after this patch the Verifier will report a fatal error. I believe this behavior is actually more desirable anyway. Differential Revision: https://reviews.llvm.org/D38184 llvm-svn: 314699
Diffstat (limited to 'llvm/test/DebugInfo/Generic')
-rw-r--r--llvm/test/DebugInfo/Generic/invalid.ll3
-rw-r--r--llvm/test/DebugInfo/Generic/location-verifier.ll3
-rw-r--r--llvm/test/DebugInfo/Generic/piece-verifier.ll3
3 files changed, 6 insertions, 3 deletions
diff --git a/llvm/test/DebugInfo/Generic/invalid.ll b/llvm/test/DebugInfo/Generic/invalid.ll
index fdb68d9cca3..9bf9e6374fc 100644
--- a/llvm/test/DebugInfo/Generic/invalid.ll
+++ b/llvm/test/DebugInfo/Generic/invalid.ll
@@ -1,4 +1,4 @@
-; RUN: not opt -verify %s 2>&1 | FileCheck %s
+; RUN: llvm-as -disable-output %s 2>&1 | FileCheck %s
; Make sure we emit this diagnostic only once (which means we don't visit the
; same DISubprogram twice.
@@ -6,6 +6,7 @@
; CHECK-NEXT: !3 = distinct !DISubprogram(name: "patatino", scope: null, isLocal: false, isDefinition: true, isOptimized: false)
; CHECK-NOT: subprogram definitions must have a compile unit
; CHECK-NOT: !3 = distinct !DISubprogram(name: "patatino", scope: null, isLocal: false, isDefinition: true, isOptimized: false)
+; CHECK: warning: ignoring invalid debug info
define void @tinkywinky() !dbg !3 { ret void }
diff --git a/llvm/test/DebugInfo/Generic/location-verifier.ll b/llvm/test/DebugInfo/Generic/location-verifier.ll
index 3decb7c9f17..b1e0805428c 100644
--- a/llvm/test/DebugInfo/Generic/location-verifier.ll
+++ b/llvm/test/DebugInfo/Generic/location-verifier.ll
@@ -1,4 +1,4 @@
-; RUN: not llvm-as -disable-output -verify-debug-info < %s 2>&1 | FileCheck %s
+; RUN: llvm-as -disable-output -verify-debug-info -o - < %s 2>&1 | FileCheck %s
; ModuleID = 'test.c'
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.10.0"
@@ -30,3 +30,4 @@ attributes #0 = { nounwind ssp uwtable }
; An old-style DILocation should not pass verify.
; CHECK: invalid !dbg metadata attachment
!13 = !{i32 2, i32 2, !4, null}
+; CHECK: warning: ignoring invalid debug info
diff --git a/llvm/test/DebugInfo/Generic/piece-verifier.ll b/llvm/test/DebugInfo/Generic/piece-verifier.ll
index e692e51a703..f7a53f22915 100644
--- a/llvm/test/DebugInfo/Generic/piece-verifier.ll
+++ b/llvm/test/DebugInfo/Generic/piece-verifier.ll
@@ -1,4 +1,4 @@
-; RUN: not llvm-as -disable-output < %s 2>&1 | FileCheck %s
+; RUN: llvm-as -disable-output < %s 2>&1 | FileCheck %s
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.9.0"
@@ -53,3 +53,4 @@ attributes #1 = { nounwind readnone }
; CHECK-NEXT: !DIExpression({{[0-9]+}}, 64, 32, {{[0-9]+}})
; CHECK-NOT: invalid expression
!27 = !DIExpression(DW_OP_LLVM_fragment, 64, 32, DW_OP_deref)
+; CHECK: warning: ignoring invalid debug info
OpenPOWER on IntegriCloud