]> granicus.if.org Git - clang/commitdiff
Enhancement to test for -ast-print
authorSerge Pavlov <sepavloff@gmail.com>
Thu, 3 Nov 2016 07:32:02 +0000 (07:32 +0000)
committerSerge Pavlov <sepavloff@gmail.com>
Thu, 3 Nov 2016 07:32:02 +0000 (07:32 +0000)
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.

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

test/Coverage/ast-printing.c

index ecaf3abeaa8ae24e44f1bbf959d02b455c338705..eb22f92e66d72e247fb84ef7b9367a435d9be036 100644 (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