3 # This tiny little script, which should be run from the clang
4 # directory (with clang-cc in your patch), tries to take each
5 # compilable Clang test and build a PCH file from that test, then read
6 # and dump the contents of the PCH file just created.
17 @files = `ls test/*/*.$suffix`;
18 foreach $file (@files) {
20 my $code = system("clang-cc -fsyntax-only -x $language $file > /dev/null 2>&1");
23 $code = system("clang-cc -emit-pch -x $language -o $file.pch $file > /dev/null 2>&1");
25 $code = system("clang-cc -include-pch $file.pch -x $language -ast-dump /dev/null > /dev/null 2>&1");
28 } elsif (($code & 0xFF) == SIGINT) {
31 print("\n---Failed to dump AST file for \"$file\"---\n");
36 } elsif (($code & 0xFF) == SIGINT) {
39 print("\n---Failed to build PCH file for \"$file\"---\n");
43 } elsif (($code & 0xFF) == SIGINT) {
51 print("\n\n$passed tests passed\n");
52 print("$failed tests failed\n");
53 print("$skipped tests skipped ('x')\n")
56 printf("-----Testing precompiled headers for C-----\n");
58 printf("\n-----Testing precompiled headers for Objective-C-----\n");
59 testfiles("m", "objective-c");