r244066 - [test/Index] Update libclang tests to use libclang for creating PCH files.

Argyrios Kyrtzidis akyrtzi at gmail.com
Wed Aug 5 10:23:59 PDT 2015


Author: akirtzidis
Date: Wed Aug  5 12:23:59 2015
New Revision: 244066

URL: http://llvm.org/viewvc/llvm-project?rev=244066&view=rev
Log:
[test/Index] Update libclang tests to use libclang for creating PCH files.

This is consistent and tests the primary configuration we want to test, libclang
creating and consuming PCH files.

Modified:
    cfe/trunk/test/Index/TestClassForwardDecl.m
    cfe/trunk/test/Index/annotate-comments-objc.m
    cfe/trunk/test/Index/annotate-comments.cpp
    cfe/trunk/test/Index/c-index-api-loadTU-test.m
    cfe/trunk/test/Index/c-index-getCursor-test.m
    cfe/trunk/test/Index/c-index-pch.c
    cfe/trunk/test/Index/c-index-redecls.c
    cfe/trunk/test/Index/cindex-from-source.m
    cfe/trunk/test/Index/comment-custom-block-command.cpp
    cfe/trunk/test/Index/comment-to-html-xml-conversion.cpp
    cfe/trunk/test/Index/complete-pch.m
    cfe/trunk/test/Index/parse-all-comments.c
    cfe/trunk/test/Index/print-mangled-name.cpp

Modified: cfe/trunk/test/Index/TestClassForwardDecl.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/TestClassForwardDecl.m?rev=244066&r1=244065&r2=244066&view=diff
==============================================================================
--- cfe/trunk/test/Index/TestClassForwardDecl.m (original)
+++ cfe/trunk/test/Index/TestClassForwardDecl.m Wed Aug  5 12:23:59 2015
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fblocks -emit-pch -x objective-c %s -o %t.ast
+// RUN: c-index-test -write-pch %t.ast -Xclang -triple -Xclang x86_64-apple-darwin10 -fblocks -x objective-c %s
 // RUN: c-index-test -test-file-scan %t.ast %s | FileCheck -check-prefix=CHECK-scan %s
 // RUN: c-index-test -test-load-tu %t.ast local | FileCheck -check-prefix=CHECK-load %s
 // REQUIRES: x86-registered-target

Modified: cfe/trunk/test/Index/annotate-comments-objc.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/annotate-comments-objc.m?rev=244066&r1=244065&r2=244066&view=diff
==============================================================================
--- cfe/trunk/test/Index/annotate-comments-objc.m (original)
+++ cfe/trunk/test/Index/annotate-comments-objc.m Wed Aug  5 12:23:59 2015
@@ -69,6 +69,7 @@ typedef struct Struct_notdoxy *typedef_i
 // RUN: %clang_cc1 -emit-pch -o %t/out.pch -F %S/Inputs/Frameworks %s
 // RUN: %clang_cc1 -include-pch %t/out.pch -F %S/Inputs/Frameworks -fsyntax-only %s
 
+// RUN: c-index-test -write-pch %t/out.pch -F %S/Inputs/Frameworks %s
 // RUN: c-index-test -test-load-source all -comments-xml-schema=%S/../../bindings/xml/comment-xml-schema.rng %s -F %S/Inputs/Frameworks > %t/out.c-index-direct
 // RUN: c-index-test -test-load-source all -comments-xml-schema=%S/../../bindings/xml/comment-xml-schema.rng %s -F %S/Inputs/Frameworks -fmodules -fmodules-cache-path=%t/module-cache > %t/out.c-index-modules
 // RUN: c-index-test -test-load-tu %t/out.pch all -F %S/Inputs/Frameworks > %t/out.c-index-pch

Modified: cfe/trunk/test/Index/annotate-comments.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/annotate-comments.cpp?rev=244066&r1=244065&r2=244066&view=diff
==============================================================================
--- cfe/trunk/test/Index/annotate-comments.cpp (original)
+++ cfe/trunk/test/Index/annotate-comments.cpp Wed Aug  5 12:23:59 2015
@@ -263,6 +263,7 @@ void isdoxy54(int);
 // RUN: %clang_cc1 -x c++ -std=c++11 -emit-pch -o %t/out.pch %s
 // RUN: %clang_cc1 -x c++ -std=c++11 -include-pch %t/out.pch -fsyntax-only %s
 
+// RUN: c-index-test -write-pch %t/out.pch -x c++ -std=c++11 %s
 // RUN: c-index-test -test-load-source all -comments-xml-schema=%S/../../bindings/xml/comment-xml-schema.rng %s -std=c++11 > %t/out.c-index-direct
 // RUN: c-index-test -test-load-tu %t/out.pch all > %t/out.c-index-pch
 

Modified: cfe/trunk/test/Index/c-index-api-loadTU-test.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/c-index-api-loadTU-test.m?rev=244066&r1=244065&r2=244066&view=diff
==============================================================================
--- cfe/trunk/test/Index/c-index-api-loadTU-test.m (original)
+++ cfe/trunk/test/Index/c-index-api-loadTU-test.m Wed Aug  5 12:23:59 2015
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fblocks -emit-pch -x objective-c %s -o %t.ast
+// RUN: c-index-test -write-pch %t.ast -Xclang -triple -Xclang x86_64-apple-darwin10 -fblocks -x objective-c %s
 // RUN: c-index-test -test-load-tu %t.ast all > %t 2>&1 && FileCheck --input-file=%t %s
 // REQUIRES: x86-registered-target
 @interface Foo 

Modified: cfe/trunk/test/Index/c-index-getCursor-test.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/c-index-getCursor-test.m?rev=244066&r1=244065&r2=244066&view=diff
==============================================================================
--- cfe/trunk/test/Index/c-index-getCursor-test.m (original)
+++ cfe/trunk/test/Index/c-index-getCursor-test.m Wed Aug  5 12:23:59 2015
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fblocks -emit-pch -x objective-c %s -detailed-preprocessing-record -o %t.ast
+// RUN: c-index-test -write-pch %t.ast -Xclang -triple -Xclang x86_64-apple-darwin10 -fblocks -x objective-c %s
 // RUN: c-index-test -test-file-scan %t.ast %s > %t 2>&1 && FileCheck --input-file=%t %s
 @interface Foo 
 {

Modified: cfe/trunk/test/Index/c-index-pch.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/c-index-pch.c?rev=244066&r1=244065&r2=244066&view=diff
==============================================================================
--- cfe/trunk/test/Index/c-index-pch.c (original)
+++ cfe/trunk/test/Index/c-index-pch.c Wed Aug  5 12:23:59 2015
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -emit-pch -x c -o %t.pch %S/Inputs/c-index-pch.h
-// RUN: %clang_cc1 -include-pch %t.pch -x c -emit-pch -o %t.ast %s
+// RUN: c-index-test -write-pch %t.pch -x c %S/Inputs/c-index-pch.h
+// RUN: c-index-test -write-pch %t.ast -Xclang -include-pch -Xclang %t.pch -x c %s
 // RUN: c-index-test -test-load-tu %t.ast all | FileCheck -check-prefix=ALL %s
 // ALL: FunctionDecl=foo
 // ALL: VarDecl=bar

Modified: cfe/trunk/test/Index/c-index-redecls.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/c-index-redecls.c?rev=244066&r1=244065&r2=244066&view=diff
==============================================================================
--- cfe/trunk/test/Index/c-index-redecls.c (original)
+++ cfe/trunk/test/Index/c-index-redecls.c Wed Aug  5 12:23:59 2015
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-pch -o %t.ast %s
+// RUN: c-index-test -write-pch %t.ast %s
 // RUN: c-index-test -test-load-tu %t.ast all
 
 // rdar://8956193 - We would blow the thread stack because of nested calls due

Modified: cfe/trunk/test/Index/cindex-from-source.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/cindex-from-source.m?rev=244066&r1=244065&r2=244066&view=diff
==============================================================================
--- cfe/trunk/test/Index/cindex-from-source.m (original)
+++ cfe/trunk/test/Index/cindex-from-source.m Wed Aug  5 12:23:59 2015
@@ -1,5 +1,5 @@
 // REQUIRES: native
-// RUN: %clang -x objective-c-header %S/Inputs/cindex-from-source.h -o %t.pfx.h.gch
+// RUN: c-index-test -write-pch %t.pfx.h.gch -x objective-c-header %S/Inputs/cindex-from-source.h
 // RUN: c-index-test -test-load-source local %s -include %t.pfx.h > %t
 // RUN: FileCheck %s < %t
 // CHECK: cindex-from-source.m:{{.*}}:{{.*}}: StructDecl=s0:{{.*}}:{{.*}}

Modified: cfe/trunk/test/Index/comment-custom-block-command.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/comment-custom-block-command.cpp?rev=244066&r1=244065&r2=244066&view=diff
==============================================================================
--- cfe/trunk/test/Index/comment-custom-block-command.cpp (original)
+++ cfe/trunk/test/Index/comment-custom-block-command.cpp Wed Aug  5 12:23:59 2015
@@ -5,6 +5,7 @@
 // RUN: %clang_cc1 -fcomment-block-commands=CustomCommand -x c++ -std=c++11 -emit-pch -o %t/out.pch %s
 // RUN: %clang_cc1 -x c++ -std=c++11 -fcomment-block-commands=CustomCommand -include-pch %t/out.pch -fsyntax-only %s
 
+// RUN: c-index-test -write-pch %t/out.pch -fcomment-block-commands=CustomCommand -x c++ -std=c++11 %s
 // RUN: c-index-test -test-load-source all -comments-xml-schema=%S/../../bindings/xml/comment-xml-schema.rng %s -std=c++11 -fcomment-block-commands=CustomCommand > %t/out.c-index-direct
 // RUN: c-index-test -test-load-tu %t/out.pch all > %t/out.c-index-pch
 

Modified: cfe/trunk/test/Index/comment-to-html-xml-conversion.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/comment-to-html-xml-conversion.cpp?rev=244066&r1=244065&r2=244066&view=diff
==============================================================================
--- cfe/trunk/test/Index/comment-to-html-xml-conversion.cpp (original)
+++ cfe/trunk/test/Index/comment-to-html-xml-conversion.cpp Wed Aug  5 12:23:59 2015
@@ -7,6 +7,7 @@
 // RUN: %clang_cc1 -x c++ -std=c++11 -emit-pch -o %t/out.pch %s
 // RUN: %clang_cc1 -x c++ -std=c++11 -include-pch %t/out.pch -fsyntax-only %s
 
+// RUN: c-index-test -write-pch %t/out.pch -x c++ -std=c++11 %s
 // RUN: c-index-test -test-load-source all -comments-xml-schema=%S/../../bindings/xml/comment-xml-schema.rng %s -std=c++11 > %t/out.c-index-direct
 // RUN: c-index-test -test-load-tu %t/out.pch all > %t/out.c-index-pch
 

Modified: cfe/trunk/test/Index/complete-pch.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/complete-pch.m?rev=244066&r1=244065&r2=244066&view=diff
==============================================================================
--- cfe/trunk/test/Index/complete-pch.m (original)
+++ cfe/trunk/test/Index/complete-pch.m Wed Aug  5 12:23:59 2015
@@ -14,7 +14,7 @@ void msg_id(id x) {
 // REQUIRES: native
 
 // Build the precompiled header
-// RUN: %clang -x objective-c-header -o %t.h.pch %S/Inputs/complete-pch.h
+// RUN: c-index-test -write-pch %t.h.pch -x objective-c-header %S/Inputs/complete-pch.h
 
 // Run the actual tests
 // RUN: c-index-test -code-completion-at=%s:10:7 -include %t.h %s | FileCheck -check-prefix=CHECK-CC1 %s

Modified: cfe/trunk/test/Index/parse-all-comments.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/parse-all-comments.c?rev=244066&r1=244065&r2=244066&view=diff
==============================================================================
--- cfe/trunk/test/Index/parse-all-comments.c (original)
+++ cfe/trunk/test/Index/parse-all-comments.c Wed Aug  5 12:23:59 2015
@@ -73,7 +73,7 @@ int trdoxyO;
 // RUN: rm -rf %t
 // RUN: mkdir %t
 
-// RUN: %clang_cc1 -fparse-all-comments -x c++ -std=c++11 -emit-pch -o %t/out.pch %s
+// RUN: c-index-test -write-pch %t/out.pch -fparse-all-comments -x c++ -std=c++11 %s
 
 // RUN: c-index-test -test-load-source all -comments-xml-schema=%S/../../bindings/xml/comment-xml-schema.rng %s -std=c++11 -fparse-all-comments > %t/out.c-index-direct
 // RUN: c-index-test -test-load-tu %t/out.pch all > %t/out.c-index-pch

Modified: cfe/trunk/test/Index/print-mangled-name.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/print-mangled-name.cpp?rev=244066&r1=244065&r2=244066&view=diff
==============================================================================
--- cfe/trunk/test/Index/print-mangled-name.cpp (original)
+++ cfe/trunk/test/Index/print-mangled-name.cpp Wed Aug  5 12:23:59 2015
@@ -1,11 +1,11 @@
 // REQUIRES: x86-registered-target
-// RUN: %clang_cc1 -triple i686-pc-linux-gnu -emit-pch %s -o %t_linux.ast
+// RUN: c-index-test -write-pch %t_linux.ast -Xclang -triple -Xclang i686-pc-linux-gnu %s
 // RUN: c-index-test -test-print-mangle %t_linux.ast | FileCheck %s --check-prefix=ITANIUM
 
-// RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-pch %s -o %t_macho.ast
+// RUN: c-index-test -write-pch %t_macho.ast -Xclang -triple -Xclang x86_64-apple-darwin %s
 // RUN: c-index-test -test-print-mangle %t_macho.ast | FileCheck %s --check-prefix=MACHO
 
-// RUN: %clang_cc1 -triple i686-pc-win32 -emit-pch %s -o %t_msft.ast
+// RUN: c-index-test -write-pch %t_msft.ast -Xclang -triple -Xclang i686-pc-win32 %s
 // RUN: c-index-test -test-print-mangle %t_msft.ast | FileCheck %s --check-prefix=MICROSOFT
 
 int foo(int, int);




More information about the cfe-commits mailing list