]> granicus.if.org Git - clang/commitdiff
Add tests for llvm-bcanalyzer stream types
authorBrian Gesiak <modocache@gmail.com>
Sun, 22 Apr 2018 00:04:35 +0000 (00:04 +0000)
committerBrian Gesiak <modocache@gmail.com>
Sun, 22 Apr 2018 00:04:35 +0000 (00:04 +0000)
Summary:
Add tests for the improved stream type detection added to
`llvm-bcanalyzer` in https://reviews.llvm.org/D41979.

Test Plan: `check-clang`

Reviewers: pcc, aprantl, mehdi_amini, george.karpenkov

Reviewed By: aprantl

Subscribers: cfe-commits, a.sidorin

Differential Revision: https://reviews.llvm.org/D41980

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@330530 91177308-0d34-0410-b5e6-96231b3b80d8

test/Misc/serialized-diags-bcanalyzer.c [new file with mode: 0644]
test/PCH/include-stream-type.cpp [new file with mode: 0644]

diff --git a/test/Misc/serialized-diags-bcanalyzer.c b/test/Misc/serialized-diags-bcanalyzer.c
new file mode 100644 (file)
index 0000000..b58f65e
--- /dev/null
@@ -0,0 +1,3 @@
+// RUN: %clang -Wall -fsyntax-only %s --serialize-diagnostics %t.diag > /dev/null 2>&1
+// RUN: llvm-bcanalyzer -dump %t.diag | FileCheck %s
+// CHECK: Stream type: Clang Serialized Diagnostics
diff --git a/test/PCH/include-stream-type.cpp b/test/PCH/include-stream-type.cpp
new file mode 100644 (file)
index 0000000..30e2586
--- /dev/null
@@ -0,0 +1,10 @@
+// Test that llvm-bcanalyzer recognizes the stream type of a PCH file.
+
+// RUN: mkdir -p %t-dir
+// Copying files allow for read-only checkouts to run this test.
+// RUN: cp %S/Inputs/pragma-once2-pch.h %t-dir
+// RUN: cp %S/Inputs/pragma-once2.h %t-dir
+// RUN: %clang_cc1 -x c++-header -emit-pch -fmodule-format=raw -o %t %t-dir/pragma-once2-pch.h
+// RUN: llvm-bcanalyzer -dump %t | FileCheck %s
+//
+// CHECK: Stream type: Clang Serialized AST