1*67e74705SXin Li // The run lines are below, because this test is line- and
2*67e74705SXin Li // column-number sensitive.
3*67e74705SXin Li struct Foo {
4*67e74705SXin Li void babble() const volatile;
5*67e74705SXin Li void bar();
6*67e74705SXin Li void baz() const;
7*67e74705SXin Li void bingo() volatile;
8*67e74705SXin Li void theend() const volatile;
9*67e74705SXin Li };
10*67e74705SXin Li
11*67e74705SXin Li template<typename T>
12*67e74705SXin Li struct smart_ptr {
13*67e74705SXin Li T *operator->();
14*67e74705SXin Li const T* operator->() const;
15*67e74705SXin Li };
16*67e74705SXin Li
text(Foo f,Foo * fp,const Foo & fc,const Foo * fcp,smart_ptr<Foo> sf,const smart_ptr<Foo> & sfc,Foo volatile * fvp)17*67e74705SXin Li void text(Foo f, Foo *fp, const Foo &fc, const Foo *fcp,
18*67e74705SXin Li smart_ptr<Foo> sf, const smart_ptr<Foo> &sfc, Foo volatile *fvp) {
19*67e74705SXin Li f.bar();
20*67e74705SXin Li fp->bar();
21*67e74705SXin Li fc.baz();
22*67e74705SXin Li fcp->baz();
23*67e74705SXin Li sf->bar();
24*67e74705SXin Li sfc->baz();
25*67e74705SXin Li fvp->babble();
26*67e74705SXin Li }
27*67e74705SXin Li
bar()28*67e74705SXin Li void Foo::bar() {
29*67e74705SXin Li
30*67e74705SXin Li }
31*67e74705SXin Li
baz() const32*67e74705SXin Li void Foo::baz() const {
33*67e74705SXin Li
34*67e74705SXin Li }
35*67e74705SXin Li
bingo()36*67e74705SXin Li void Foo::bingo() volatile {
37*67e74705SXin Li
38*67e74705SXin Li }
39*67e74705SXin Li
40*67e74705SXin Li // Check member access expressions.
41*67e74705SXin Li // RUN: c-index-test -code-completion-at=%s:19:5 %s | FileCheck -check-prefix=CHECK-NOQUALS %s
42*67e74705SXin Li // RUN: c-index-test -code-completion-at=%s:20:7 %s | FileCheck -check-prefix=CHECK-NOQUALS %s
43*67e74705SXin Li // RUN: c-index-test -code-completion-at=%s:23:7 %s | FileCheck -check-prefix=CHECK-NOQUALS %s
44*67e74705SXin Li // CHECK-NOQUALS: CXXMethod:{ResultType void}{TypedText babble}{LeftParen (}{RightParen )}{Informative const volatile} (35)
45*67e74705SXin Li // CHECK-NOQUALS: CXXMethod:{ResultType void}{TypedText bar}{LeftParen (}{RightParen )} (34)
46*67e74705SXin Li // CHECK-NOQUALS: CXXMethod:{ResultType void}{TypedText baz}{LeftParen (}{RightParen )}{Informative const} (35)
47*67e74705SXin Li // CHECK-NOQUALS: CXXMethod:{ResultType void}{TypedText bingo}{LeftParen (}{RightParen )}{Informative volatile} (35)
48*67e74705SXin Li // RUN: c-index-test -code-completion-at=%s:21:6 %s | FileCheck -check-prefix=CHECK-CONST %s
49*67e74705SXin Li // RUN: c-index-test -code-completion-at=%s:22:8 %s | FileCheck -check-prefix=CHECK-CONST %s
50*67e74705SXin Li // RUN: c-index-test -code-completion-at=%s:24:8 %s | FileCheck -check-prefix=CHECK-CONST %s
51*67e74705SXin Li // CHECK-CONST: CXXMethod:{ResultType void}{TypedText babble}{LeftParen (}{RightParen )}{Informative const volatile} (35)
52*67e74705SXin Li // CHECK-CONST-NOT: bar
53*67e74705SXin Li // CHECK-CONST: CXXMethod:{ResultType void}{TypedText baz}{LeftParen (}{RightParen )}{Informative const} (34)
54*67e74705SXin Li // CHECK-CONST-NOT: bingo
55*67e74705SXin Li // CHECK-CONST: theend
56*67e74705SXin Li // RUN: c-index-test -code-completion-at=%s:25:8 %s | FileCheck -check-prefix=CHECK-VOLATILE %s
57*67e74705SXin Li // CHECK-VOLATILE: CXXMethod:{ResultType void}{TypedText babble}{LeftParen (}{RightParen )}{Informative const volatile} (35)
58*67e74705SXin Li // CHECK-VOLATILE-NOT: baz
59*67e74705SXin Li // CHECK-VOLATILE: CXXMethod:{ResultType void}{TypedText bingo}{LeftParen (}{RightParen )}{Informative volatile} (34)
60*67e74705SXin Li
61*67e74705SXin Li // Check implicit member access expressions.
62*67e74705SXin Li // RUN: c-index-test -code-completion-at=%s:29:2 %s | FileCheck -check-prefix=CHECK-IMPLICIT-NOQUALS %s
63*67e74705SXin Li // CHECK-IMPLICIT-NOQUALS: CXXMethod:{ResultType void}{TypedText babble}{LeftParen (}{RightParen )}{Informative const volatile} (35)
64*67e74705SXin Li // CHECK-IMPLICIT-NOQUALS: CXXMethod:{ResultType void}{TypedText bar}{LeftParen (}{RightParen )} (34)
65*67e74705SXin Li // CHECK-IMPLICIT-NOQUALS: CXXMethod:{ResultType void}{TypedText baz}{LeftParen (}{RightParen )}{Informative const} (35)
66*67e74705SXin Li // CHECK-IMPLICIT-NOQUALS: CXXMethod:{ResultType void}{TypedText bingo}{LeftParen (}{RightParen )}{Informative volatile} (35)
67*67e74705SXin Li
68*67e74705SXin Li // RUN: c-index-test -code-completion-at=%s:33:1 %s | FileCheck -check-prefix=CHECK-IMPLICIT-CONST %s
69*67e74705SXin Li // CHECK-IMPLICIT-CONST: CXXMethod:{ResultType void}{TypedText babble}{LeftParen (}{RightParen )}{Informative const volatile} (35)
70*67e74705SXin Li // CHECK-IMPLICIT-CONST-NOT: bar
71*67e74705SXin Li // CHECK-IMPLICIT-CONST: CXXMethod:{ResultType void}{TypedText baz}{LeftParen (}{RightParen )}{Informative const} (34)
72*67e74705SXin Li // CHECK-IMPLICIT-CONST-NOT: bingo
73*67e74705SXin Li // CHECK-IMPLICIT-CONST: theend
74*67e74705SXin Li
75*67e74705SXin Li // RUN: c-index-test -code-completion-at=%s:37:1 %s | FileCheck -check-prefix=CHECK-IMPLICIT-VOLATILE %s
76*67e74705SXin Li // CHECK-IMPLICIT-VOLATILE: CXXMethod:{ResultType void}{TypedText babble}{LeftParen (}{RightParen )}{Informative const volatile} (35)
77*67e74705SXin Li // CHECK-IMPLICIT-VOLATILE-NOT: baz
78*67e74705SXin Li // CHECK-IMPLICIT-VOLATILE: CXXMethod:{ResultType void}{TypedText bingo}{LeftParen (}{RightParen )}{Informative volatile} (34)
79*67e74705SXin Li
80*67e74705SXin Li // RUN: c-index-test -code-completion-at=%s:4:17 %s | FileCheck -check-prefix=CHECK-CVQUAL-AFTER %s
81*67e74705SXin Li // CHECK-CVQUAL-AFTER: NotImplemented:{TypedText const} (40)
82*67e74705SXin Li // CHECK-CVQUAL-AFTER: NotImplemented:{TypedText volatile} (40)
83*67e74705SXin Li
84*67e74705SXin Li // RUN: c-index-test -code-completion-at=%s:4:23 %s | FileCheck -check-prefix=CHECK-CVQUAL-AFTER2 %s
85*67e74705SXin Li // CHECK-CVQUAL-AFTER2-NOT: NotImplemented:{TypedText const} (40)
86*67e74705SXin Li // CHECK-CVQUAL-AFTER2: NotImplemented:{TypedText volatile} (40)
87