Enhancement to test for -ast-print

Present tests for the functionality provided by command lime option
`-ast-print` check only absence of crash. This change tries to make
testing better, - the output produced by the compiler is compiled again
with option `-print-ast` and both outputs are compared. Such test at
least checks that the output is valid code. This change fixes only the
test for pure C.

This is recommit of r285882.

llvm-svn: 285981
This commit is contained in:
Serge Pavlov 2016-11-04 06:09:23 +00:00
parent ede11636a5
commit 22349ffa5d
1 changed files with 3 additions and 1 deletions

View File

@ -1,5 +1,7 @@
// RUN: %clang_cc1 -fsyntax-only %s
// RUN: %clang_cc1 -ast-print %s
// RUN: %clang_cc1 -ast-print %s -o %t.1.c
// RUN: %clang_cc1 -ast-print %t.1.c -o %t.2.c
// RUN: diff %t.1.c %t.2.c
// RUN: %clang_cc1 -ast-dump %s
// RUN: %clang_cc1 -print-decl-contexts %s