3 # This tiny little script, which should be run from the clang
4 # directory (with clang 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.
18 @files = `ls test/*/*.$suffix`;
19 foreach $file (@files) {
21 my $code = system("clang -fsyntax-only -x $language $file > /dev/null 2>&1");
24 $code = system("clang -cc1 -emit-pch -x $language -o $file.pch $file > /dev/null 2>&1");
26 $code = system("clang -cc1 -include-pch $file.pch -x $language -ast-dump /dev/null > /dev/null 2>&1");
29 } elsif (($code & 0xFF) == SIGINT
) {
32 print("\n---Failed to dump AST file for \"$file\"---\n");
37 } elsif (($code & 0xFF) == SIGINT
) {
40 print("\n---Failed to build PCH file for \"$file\"---\n");
44 } elsif (($code & 0xFF) == SIGINT
) {
52 print("\n\n$passed tests passed\n");
53 print("$failed tests failed\n");
54 print("$skipped tests skipped ('x')\n")
57 printf("-----Testing precompiled headers for C-----\n");
59 printf("\n-----Testing precompiled headers for Objective-C-----\n");
60 testfiles
("m", "objective-c");