diff options
Diffstat (limited to 'test/CodeCompletion')
-rw-r--r-- | test/CodeCompletion/function-templates.cpp | 15 | ||||
-rw-r--r-- | test/CodeCompletion/member-access.cpp | 6 | ||||
-rw-r--r-- | test/CodeCompletion/objc-message.m | 4 | ||||
-rw-r--r-- | test/CodeCompletion/templates.cpp | 24 |
4 files changed, 35 insertions, 14 deletions
diff --git a/test/CodeCompletion/function-templates.cpp b/test/CodeCompletion/function-templates.cpp index d291bbe..302b955 100644 --- a/test/CodeCompletion/function-templates.cpp +++ b/test/CodeCompletion/function-templates.cpp @@ -6,9 +6,18 @@ namespace std { X* dyn_cast(Y *Val); } +class Foo { +public: + template<typename T> T &getAs(); +}; + void f() { - std:: - // RUN: clang-cc -fsyntax-only -code-completion-at=%s:10:8 %s -o - | FileCheck -check-prefix=CC1 %s + std::sort(1, 2); + Foo().getAs<int>(); + // RUN: clang-cc -fsyntax-only -code-completion-at=%s:15:8 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s // CHECK-CC1: dyn_cast<<#class X#>>(<#Y *Val#>) - // CHECK-CC1: sort(<#RandomAccessIterator first#>, <#RandomAccessIterator last#>) + // CHECK-CC1: sort(<#RandomAccessIterator first#>, <#RandomAccessIterator last#> + // RUN: clang-cc -fsyntax-only -code-completion-at=%s:16:9 %s -o - | FileCheck -check-prefix=CHECK-CC2 %s + // CHECK-CC2: getAs<<#typename T#>>() +) diff --git a/test/CodeCompletion/member-access.cpp b/test/CodeCompletion/member-access.cpp index e445b45..d03180b 100644 --- a/test/CodeCompletion/member-access.cpp +++ b/test/CodeCompletion/member-access.cpp @@ -11,7 +11,7 @@ struct Base2 { struct Base3 : Base1, Base2 { void memfun1(float); - void memfun1(double); + void memfun1(double) const; void memfun2(int); }; @@ -34,9 +34,9 @@ void test(const Proxy &p) { // CHECK-CC1: member3 : 0 // CHECK-CC1: member4 : 0 // CHECK-CC1: memfun1 : 0 : [#Base3::#]memfun1(<#float#>) - // CHECK-CC1: memfun1 : 0 : [#Base3::#]memfun1(<#double#>) + // CHECK-CC1: memfun1 : 0 : [#Base3::#]memfun1(<#double#>)[# const#] // CHECK-CC1: memfun2 : 0 : [#Base3::#]memfun2(<#int#>) // CHECK-CC1: memfun3 : 0 : memfun3(<#int#>) - // CHECK-CC1: Base1 : 0 : Base1:: // CHECK-CC1: memfun1 : 0 (Hidden) : Base2::memfun1(<#int#>) + // CHECK-CC1: Base1 : 3 : Base1:: diff --git a/test/CodeCompletion/objc-message.m b/test/CodeCompletion/objc-message.m index d16a745..58fc4f5 100644 --- a/test/CodeCompletion/objc-message.m +++ b/test/CodeCompletion/objc-message.m @@ -23,13 +23,13 @@ void func() { Foo *obj = [Foo new]; [obj xx]; } -// RUN: clang-cc -fsyntax-only -code-completion-at=%s:23:19 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s +// RUN: clang -cc1 -fsyntax-only -code-completion-at=%s:23:19 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s // CHECK-CC1: categoryClassMethod : 0 // CHECK-CC1: classMethod1:withKeyword: : 0 // CHECK-CC1: classMethod2 : 0 // CHECK-CC1: new : 0 // CHECK-CC1: protocolClassMethod : 0 -// RUN: clang-cc -fsyntax-only -code-completion-at=%s:24:8 %s -o - | FileCheck -check-prefix=CHECK-CC2 %s +// RUN: clang -cc1 -fsyntax-only -code-completion-at=%s:24:8 %s -o - | FileCheck -check-prefix=CHECK-CC2 %s // CHECK-CC2: categoryInstanceMethod : 0 // CHECK-CC2: instanceMethod1 : 0 // CHECK-CC2: protocolInstanceMethod : 0 diff --git a/test/CodeCompletion/templates.cpp b/test/CodeCompletion/templates.cpp index d35e0bb..ff56118 100644 --- a/test/CodeCompletion/templates.cpp +++ b/test/CodeCompletion/templates.cpp @@ -1,16 +1,28 @@ namespace std { template<typename T> - class allocator; + class allocator { + public: + void in_base(); + }; template<typename T, typename Alloc = std::allocator<T> > - class vector; + class vector : Alloc { + public: + void foo(); + void stop(); + }; + template<typename Alloc> class vector<bool, Alloc>; } void f() { - std:: - // RUN: clang-cc -fsyntax-only -code-completion-at=%s:10:8 %s -o - | FileCheck -check-prefix=CC1 %s + std::vector<int> v; + v.foo(); + // RUN: clang-cc -fsyntax-only -code-completion-at=%s:18:8 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s // CHECK-CC1: allocator<<#typename T#>> - // CHECK-CC1: vector<<#typename T#>{#, <#typename Alloc#>#}> - + // CHECK-CC1-NEXT: vector<<#typename T#>{#, <#typename Alloc#>#}> + // RUN: clang-cc -fsyntax-only -code-completion-at=%s:19:5 %s -o - | FileCheck -check-prefix=CHECK-CC2 %s + // CHECK-CC2: foo + // CHECK-CC2: in_base + // CHECK-CC2: stop |