forked from llvm-mirror/llvm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[bcanalyzer] Recognize more stream types
Summary: `llvm-bcanalyzer` prints out the stream type of the file it is analyzing. If the file begins with the LLVM IR magic number, it reports a stream type of "LLVM IR". However, any other bitstream format is reported as "unknown". Add some checks for two other common bitstream formats: Clang AST files, which begin with 'CPCH', and Clang serialized diagnostics, which begin with 'DIAG'. Test Plan: `check-llvm` Reviewers: pcc, aprantl, mehdi_amini, davide, george.karpenkov, JDevlieghere Reviewed By: JDevlieghere Subscribers: JDevlieghere, bruno, davide, llvm-commits Differential Revision: https://reviews.llvm.org/D41979 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@330529 91177308-0d34-0410-b5e6-96231b3b80d8
- Loading branch information
Showing
6 changed files
with
61 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// Tests that llvm-bcanalyzer recognizes the correct "stream type" for various | ||
// common bitstream formats. | ||
|
||
// RUN: llvm-bcanalyzer -dump %s.ast | FileCheck %s -check-prefix=CHECK-AST | ||
// CHECK-AST: Stream type: Clang Serialized AST | ||
|
||
// RUN: llvm-bcanalyzer -dump %s.dia | FileCheck %s -check-prefix=CHECK-DIAG | ||
// CHECK-DIAG: Stream type: Clang Serialized Diagnostics | ||
|
||
// RUN: not llvm-bcanalyzer -dump %s.ast.incomplete 2>&1 | FileCheck %s -check-prefix=CHECK-INCOMPLETE | ||
// RUN: not llvm-bcanalyzer -dump %s.dia.incomplete 2>&1 | FileCheck %s -check-prefix=CHECK-INCOMPLETE | ||
// CHECK-INCOMPLETE: Bitcode stream should be a multiple of 4 bytes in length |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
CPCH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
CP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
DIAG |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
DIA |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters