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
--- /dev/null
+// 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
--- /dev/null
+// 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