From 04421f50438d8496be04b8581cad15600e49b5ac Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Wed, 5 Aug 2015 17:23:59 +0000 Subject: [PATCH] [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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@244066 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Index/TestClassForwardDecl.m | 2 +- test/Index/annotate-comments-objc.m | 1 + test/Index/annotate-comments.cpp | 1 + test/Index/c-index-api-loadTU-test.m | 2 +- test/Index/c-index-getCursor-test.m | 2 +- test/Index/c-index-pch.c | 4 ++-- test/Index/c-index-redecls.c | 2 +- test/Index/cindex-from-source.m | 2 +- test/Index/comment-custom-block-command.cpp | 1 + test/Index/comment-to-html-xml-conversion.cpp | 1 + test/Index/complete-pch.m | 2 +- test/Index/parse-all-comments.c | 2 +- test/Index/print-mangled-name.cpp | 6 +++--- 13 files changed, 16 insertions(+), 12 deletions(-) diff --git a/test/Index/TestClassForwardDecl.m b/test/Index/TestClassForwardDecl.m index 284406f644..5d43dbf96e 100644 --- a/test/Index/TestClassForwardDecl.m +++ b/test/Index/TestClassForwardDecl.m @@ -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 diff --git a/test/Index/annotate-comments-objc.m b/test/Index/annotate-comments-objc.m index a8eaa0b038..471bc2bcb2 100644 --- a/test/Index/annotate-comments-objc.m +++ b/test/Index/annotate-comments-objc.m @@ -69,6 +69,7 @@ typedef struct Struct_notdoxy *typedef_isdoxy1; // 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 diff --git a/test/Index/annotate-comments.cpp b/test/Index/annotate-comments.cpp index 6612a44792..6f9f8f0bbb 100644 --- a/test/Index/annotate-comments.cpp +++ b/test/Index/annotate-comments.cpp @@ -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 diff --git a/test/Index/c-index-api-loadTU-test.m b/test/Index/c-index-api-loadTU-test.m index cbd742b240..83ef6e8313 100644 --- a/test/Index/c-index-api-loadTU-test.m +++ b/test/Index/c-index-api-loadTU-test.m @@ -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 diff --git a/test/Index/c-index-getCursor-test.m b/test/Index/c-index-getCursor-test.m index f368f1f074..502d448c61 100644 --- a/test/Index/c-index-getCursor-test.m +++ b/test/Index/c-index-getCursor-test.m @@ -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 { diff --git a/test/Index/c-index-pch.c b/test/Index/c-index-pch.c index 313fae88f4..4a035d7ad8 100644 --- a/test/Index/c-index-pch.c +++ b/test/Index/c-index-pch.c @@ -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 diff --git a/test/Index/c-index-redecls.c b/test/Index/c-index-redecls.c index 0cf2f032a3..67e58684e8 100644 --- a/test/Index/c-index-redecls.c +++ b/test/Index/c-index-redecls.c @@ -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 diff --git a/test/Index/cindex-from-source.m b/test/Index/cindex-from-source.m index 504d90fd2b..5ea8504d67 100644 --- a/test/Index/cindex-from-source.m +++ b/test/Index/cindex-from-source.m @@ -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:{{.*}}:{{.*}} diff --git a/test/Index/comment-custom-block-command.cpp b/test/Index/comment-custom-block-command.cpp index f87cef96e5..bb153dc878 100644 --- a/test/Index/comment-custom-block-command.cpp +++ b/test/Index/comment-custom-block-command.cpp @@ -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 diff --git a/test/Index/comment-to-html-xml-conversion.cpp b/test/Index/comment-to-html-xml-conversion.cpp index f31061aa12..d873076162 100644 --- a/test/Index/comment-to-html-xml-conversion.cpp +++ b/test/Index/comment-to-html-xml-conversion.cpp @@ -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 diff --git a/test/Index/complete-pch.m b/test/Index/complete-pch.m index 4c29f2796b..486a0dc53d 100644 --- a/test/Index/complete-pch.m +++ b/test/Index/complete-pch.m @@ -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 diff --git a/test/Index/parse-all-comments.c b/test/Index/parse-all-comments.c index 510a0afa63..66981e2b42 100644 --- a/test/Index/parse-all-comments.c +++ b/test/Index/parse-all-comments.c @@ -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 diff --git a/test/Index/print-mangled-name.cpp b/test/Index/print-mangled-name.cpp index d4edc5ff39..eb1ea8c57b 100644 --- a/test/Index/print-mangled-name.cpp +++ b/test/Index/print-mangled-name.cpp @@ -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); -- 2.40.0