Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeCompletion / keywords.cpp
blob977407052beaac05dbae8c5b903bc54e7cadc5e4
1 int function(int x) {
2 return x + 1;
5 int variable = 0;
7 class Class {
8 public:
9 Class() { }
11 int method(int x) {
12 return x + 1;
15 virtual void virtualMethod() {
18 static void staticMethod() {
21 static int staticVar;
24 class SubClass : public Class {
25 void virtualMethod() override final {
29 struct Struct {
32 // RUN: %clang_cc1 -std=c++11 -code-completion-at=%s:1:1 %s | FileCheck --check-prefix=CHECK-TOP-LEVEL %s
33 // RUN: %clang_cc1 -std=c++11 -code-completion-at=%s:5:1 %s | FileCheck --check-prefix=CHECK-TOP-LEVEL %s
34 // RUN: %clang_cc1 -std=c++11 -code-completion-at=%s:11:1 %s | FileCheck --check-prefix=CHECK-TOP-LEVEL %s
35 // CHECK-TOP-LEVEL: alignas(<#expression#>)
36 // CHECK-TOP-LEVEL: constexpr
37 // CHECK-TOP-LEVEL: static_assert(<#expression#>, <#message#>);
38 // CHECK-TOP-LEVEL: thread_local
39 // CHECK-TOP-LEVEL-NOT: final
40 // CHECK-TOP-LEVEL-NOT: noexcept
42 // RUN: %clang_cc1 -std=c++11 -code-completion-at=%s:1:14 %s | FileCheck --check-prefix=CHECK-PARAM %s
43 // CHECK-PARAM-NOT: alignas
44 // CHECK-PARAM-NOT: constexpr
45 // CHECK-PARAM-NOT: final
46 // CHECK-PARAM-NOT: thread_local
48 // RUN: %clang_cc1 -std=c++11 -code-completion-at=%s:21:10 %s | FileCheck --check-prefix=CHECK-STATICVAR1 %s
49 // CHECK-STATICVAR1: constexpr
50 // CHECK-STATICVAR1: thread_local
52 // RUN: %clang_cc1 -std=c++11 -code-completion-at=%s:7:13 %s | FileCheck --check-prefix=CHECK-CLASS-QUALIFIER %s
53 // RUN: %clang_cc1 -std=c++11 -code-completion-at=%s:24:16 %s | FileCheck --check-prefix=CHECK-CLASS-QUALIFIER %s
54 // RUN: %clang_cc1 -std=c++11 -code-completion-at=%s:29:15 %s | FileCheck --check-prefix=CHECK-CLASS-QUALIFIER %s
55 // CHECK-CLASS-QUALIFIER: final
57 // RUN: %clang_cc1 -std=c++11 -code-completion-at=%s:1:21 %s | FileCheck --check-prefix=CHECK-FUNCTION-QUALIFIER %s
58 // RUN: %clang_cc1 -std=c++11 -code-completion-at=%s:9:11 %s | FileCheck --check-prefix=CHECK-FUNCTION-QUALIFIER %s
59 // RUN: %clang_cc1 -std=c++11 -code-completion-at=%s:18:30 %s | FileCheck --check-prefix=CHECK-FUNCTION-QUALIFIER %s
60 // CHECK-FUNCTION-QUALIFIER: noexcept
61 // CHECK-FUNCTION-QUALIFIER-NOT: final
62 // CHECK-FUNCTION-QUALIFIER-NOT: override
64 // RUN: %clang_cc1 -std=c++11 -code-completion-at=%s:11:21 %s | FileCheck --check-prefix=CHECK-METHOD-QUALIFIER %s
65 // RUN: %clang_cc1 -std=c++11 -code-completion-at=%s:15:32 %s | FileCheck --check-prefix=CHECK-METHOD-QUALIFIER %s
66 // RUN: %clang_cc1 -std=c++11 -code-completion-at=%s:25:24 %s | FileCheck --check-prefix=CHECK-METHOD-QUALIFIER %s
67 // CHECK-METHOD-QUALIFIER: final
68 // CHECK-METHOD-QUALIFIER: noexcept
69 // CHECK-METHOD-QUALIFIER: override
71 // RUN: %clang_cc1 -std=c++11 -code-completion-at=%s:25:33 %s | FileCheck --check-prefix=CHECK-OVERRIDE-SPECIFIED %s
72 // CHECK-OVERRIDE-SPECIFIED: final
73 // CHECK-OVERRIDE-SPECIFIED: noexcept
74 // CHECK-OVERRIDE-SPECIFIED-NOT: override
76 // RUN: %clang_cc1 -std=c++11 -code-completion-at=%s:25:39 %s | FileCheck --check-prefix=CHECK-OVERRIDE-FINAL-SPECIFIED %s
77 // CHECK-OVERRIDE-FINAL-SPECIFIED: noexcept
78 // CHECK-OVERRIDE-FINAL-SPECIFIED-NOT: final
79 // CHECK-OVERRIDE-FINAL-SPECIFIED-NOT: override