brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · 0e72b20 Raw
47 lines · plain
1// Note: the run lines follow their respective tests, since line/column2// matter in this test.3 4@protocol FooTestProtocol5+ protocolClassMethod;6- protocolInstanceMethod;7@end8@interface Foo <FooTestProtocol> {9  void *isa;10}11+ (int)classMethod1:a withKeyword:b;12+ (void)classMethod2;13+ new;14- instanceMethod1;15@end16 17@interface Foo (FooTestCategory)18+ categoryClassMethod;19- categoryInstanceMethod;20@end21 22template<typename T> struct RetainPtr {23  template <typename U> struct RemovePointer { typedef U Type; };24  template <typename U> struct RemovePointer<U*> { typedef U Type; };25    26  typedef typename RemovePointer<T>::Type* PtrType;27 28  explicit operator PtrType() const;29};30 31void func(const RetainPtr<Foo>& ptr)32{33  [ptr instanceMethod1];34}35 36void func(const RetainPtr<id <FooTestProtocol>>& ptr)37{38  [ptr instanceMethod1];39}40 41// RUN: %clang_cc1 -fsyntax-only -std=c++11 -code-completion-at=%s:%(line-8):8 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s42// CHECK-CC1: categoryInstanceMethod : [#id#]categoryInstanceMethod43// CHECK-CC1: instanceMethod1 : [#id#]instanceMethod144// CHECK-CC1: protocolInstanceMethod (InBase) : [#id#]protocolInstanceMethod45// RUN: %clang_cc1 -fsyntax-only -std=c++11 -code-completion-at=%s:%(line-7):8 %s -o - | FileCheck -check-prefix=CHECK-CC2 %s46// CHECK-CC2: protocolInstanceMethod : [#id#]protocolInstanceMethod47