r285981 - Enhancement to test for -ast-print

Serge Pavlov via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 3 23:09:24 PDT 2016

Author: sepavloff
Date: Fri Nov  4 01:09:23 2016
New Revision: 285981

URL: http://llvm.org/viewvc/llvm-project?rev=285981&view=rev
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.


Modified: cfe/trunk/test/Coverage/ast-printing.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Coverage/ast-printing.c?rev=285981&r1=285980&r2=285981&view=diff
--- cfe/trunk/test/Coverage/ast-printing.c (original)
+++ cfe/trunk/test/Coverage/ast-printing.c Fri Nov  4 01:09:23 2016
@@ -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

More information about the cfe-commits mailing list