13 // RUN: %clang_cc1 -fsyntax-only -code-completion-patterns -code-completion-at=%s:3:1 %s -o - | FileCheck -check-prefix=LOOP %s
14 // RUN: %clang_cc1 -fsyntax-only -code-completion-patterns -code-completion-at=%s:6:1 %s -o - | FileCheck -check-prefix=LOOP %s
15 // RUN: %clang_cc1 -fsyntax-only -code-completion-patterns -code-completion-at=%s:9:1 %s -o - | FileCheck -check-prefix=LOOP %s
16 // LOOP: COMPLETION: Pattern : break;{{$}}
17 // LOOP: COMPLETION: Pattern : continue;{{$}}
18 // LOOP: COMPLETION: Pattern : goto <#label#>;{{$}}
19 // LOOP: COMPLETION: Pattern : return;{{$}}
21 // RUN: %clang_cc1 -fsyntax-only -code-completion-patterns -code-completion-at=%s:11:1 %s -o - | FileCheck -check-prefix=OUTSIDE-LOOP %s
22 // OUTSIDE-LOOP-NOT: COMPLETION: Pattern : break;{{$}}
23 // OUTSIDE-LOOP-NOT: COMPLETION: Pattern : continue;{{$}}
24 // OUTSIDE-LOOP: COMPLETION: Pattern : goto <#label#>;{{$}}
25 // OUTSIDE-LOOP: COMPLETION: Pattern : return;{{$}}
40 int Cls::*memptr_return() {
43 // RUN: %clang_cc1 -fsyntax-only -code-completion-patterns -code-completion-at=%s:28:1 %s -o - | FileCheck -check-prefix=RETURN-VAL %s
44 // RETURN-VAL-NOT: COMPLETION: Pattern : return;
45 // RETURN-VAL-NOT: COMPLETION: Pattern : return false;
46 // RETURN-VAL-NOT: COMPLETION: Pattern : return true;
47 // RETURN-VAL-NOT: COMPLETION: Pattern : return nullptr;
48 // RETURN-VAL: COMPLETION: Pattern : return <#expression#>;{{$}}
50 // RUN: %clang_cc1 -fsyntax-only -code-completion-patterns -code-completion-at=%s:31:1 %s -o - | FileCheck -check-prefix=RETURN-VOID %s
51 // RETURN-VOID-NOT: COMPLETION: Pattern : return false;
52 // RETURN-VOID-NOT: COMPLETION: Pattern : return true;
53 // RETURN-VOID-NOT: COMPLETION: Pattern : return <#expression#>;
54 // RETURN-VOID-NOT: COMPLETION: Pattern : return nullptr;
55 // RETURN-VOID: COMPLETION: Pattern : return;{{$}}
57 // RUN: %clang_cc1 -fsyntax-only -code-completion-patterns -code-completion-at=%s:34:1 %s -o - | FileCheck -check-prefix=RETURN-BOOL %s
58 // RETURN-BOOL-NOT: COMPLETION: Pattern : return;
59 // RETURN-BOOL-NOT: COMPLETION: Pattern : return nullptr;
60 // RETURN-BOOL: COMPLETION: Pattern : return <#expression#>;{{$}}
61 // RETURN-BOOL: COMPLETION: Pattern : return false;{{$}}
62 // RETURN-BOOL: COMPLETION: Pattern : return true;{{$}}
64 // Check both pointer and member pointer return types.
65 // RUN: %clang_cc1 -fsyntax-only -std=c++11 -code-completion-patterns -code-completion-at=%s:37:1 %s -o - | FileCheck -check-prefix=RETURN-PTR %s
66 // RUN: %clang_cc1 -fsyntax-only -std=c++11 -code-completion-patterns -code-completion-at=%s:41:1 %s -o - | FileCheck -check-prefix=RETURN-PTR %s
67 // RETURN-PTR-NOT: COMPLETION: Pattern : return false;{{$}}
68 // RETURN-PTR-NOT: COMPLETION: Pattern : return true;{{$}}
69 // RETURN-PTR-NOT: COMPLETION: Pattern : return;
70 // RETURN-PTR: COMPLETION: Pattern : return <#expression#>;{{$}}
71 // RETURN-PTR: COMPLETION: Pattern : return nullptr;
73 // 'return nullptr' is not available before C++11.
74 // RUN: %clang_cc1 -fsyntax-only -std=c++03 -code-completion-patterns -code-completion-at=%s:37:1 %s -o - | FileCheck -check-prefix=RETURN-PTR-STD03 %s
75 // RUN: %clang_cc1 -fsyntax-only -std=c++03 -code-completion-patterns -code-completion-at=%s:41:1 %s -o - | FileCheck -check-prefix=RETURN-PTR-STD03 %s
76 // RETURN-PTR-STD03-NOT: COMPLETION: Pattern : return nullptr;
85 // RUN: %clang_cc1 -fsyntax-only -code-completion-patterns -code-completion-at=%s:83:3 %s -o - | FileCheck -check-prefix=UNBRACED-IF %s
86 // UNBRACED-IF: COMPLETION: Pattern : else
87 // UNBRACED-IF-NEXT: <#statement#>;
88 // UNBRACED-IF: COMPLETION: Pattern : else if (<#condition#>)
89 // UNBRACED-IF-NEXT: <#statement#>;
97 // RUN: %clang_cc1 -fsyntax-only -code-completion-patterns -code-completion-at=%s:95:3 %s -o - | FileCheck -check-prefix=BRACED-IF %s
98 // BRACED-IF: COMPLETION: Pattern : else {
99 // BRACED-IF-NEXT: <#statements#>
101 // BRACED-IF: COMPLETION: Pattern : else if (<#condition#>) {
102 // BRACED-IF-NEXT: <#statements#>