brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.0 KiB · 3948726 Raw
55 lines · cpp
1// Note: the run lines follow their respective tests, since line/column2// matter in this test.3void f(float x, float y);4void f(int i, int j, int k);5struct X { };6void f(X);7namespace N {8  struct Y { 9    Y(int = 0); 10    11    operator int() const;12  };13  void f(Y y, int ZZ);14}15typedef N::Y Y;16void f();17 18void test() {19  f(Y(), 0, 0);20  // RUN: %clang_cc1 -fsyntax-only -code-completion-patterns -code-completion-at=%s:%(line-1):9 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s21  // CHECK-CC1: f(Y y, <#int ZZ#>)22  // CHECK-CC1-NEXT: f(int i, <#int j#>, int k)23  // CHECK-CC1-NEXT: f(float x, <#float y#>)24  // CHECK-CC1: COMPLETION: Pattern : dynamic_cast<<#type#>>(<#expression#>)25  // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:%(line-6):13 %s -o - | FileCheck -check-prefix=CHECK-CC2 %s26  // CHECK-CC2-NOT: f(Y y, int ZZ)27  // CHECK-CC2: f(int i, int j, <#int k#>)28  f({}, 0, 0);29  // RUN: %clang_cc1 -fsyntax-only -code-completion-patterns -code-completion-at=%s:%(line-1):7 %s -o - | FileCheck -check-prefix=CHECK-CC3 %s30  // CHECK-CC3: OVERLOAD: [#void#]f()31  // CHECK-CC3-NEXT: OVERLOAD: [#void#]f(<#X#>)32  // CHECK-CC3-NEXT: OVERLOAD: [#void#]f(<#int i#>, int j, int k)33  // CHECK-CC3-NEXT: OVERLOAD: [#void#]f(<#float x#>, float y)34}35 36void f(int, int, int, int);37template <typename T>38void foo(T t) {39  f(t, t, t);40  // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:%(line-1):5 %s -o - | FileCheck -check-prefix=CHECK-CC4 %s41  // CHECK-CC4: f()42  // CHECK-CC4-NEXT: f(<#X#>)43  // CHECK-CC4-NEXT: f(<#int i#>, int j, int k)44  // CHECK-CC4-NEXT: f(<#float x#>, float y)45  // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:%(line-6):8 %s -o - | FileCheck -check-prefix=CHECK-CC5 %s46  // CHECK-CC5-NOT: f()47  // CHECK-CC5: f(int i, <#int j#>, int k)48  // CHECK-CC5-NEXT: f(float x, <#float y#>)49  f(5, t, t);50  // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:%(line-1):11 %s -o - | FileCheck -check-prefix=CHECK-CC6 %s51  // CHECK-CC6-NOT: f(float x, float y)52  // CHECK-CC6: f(int, int, <#int#>, int)53  // CHECK-CC6-NEXT: f(int i, int j, <#int k#>)54}55