r285882 - Enhancement to test for -ast-print

Serge Pavlov via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 3 00:32:03 PDT 2016


Author: sepavloff
Date: Thu Nov  3 02:32:02 2016
New Revision: 285882

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

Modified:
    cfe/trunk/test/Coverage/ast-printing.c

Modified: cfe/trunk/test/Coverage/ast-printing.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Coverage/ast-printing.c?rev=285882&r1=285881&r2=285882&view=diff
==============================================================================
--- cfe/trunk/test/Coverage/ast-printing.c (original)
+++ cfe/trunk/test/Coverage/ast-printing.c Thu Nov  3 02:32:02 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