Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeCompletion / function-templates.cpp
blob07b0cfb6180660d0a36bf6f947268afb1686788a
1 namespace std {
2 template<typename RandomAccessIterator>
3 void sort(RandomAccessIterator first, RandomAccessIterator last);
5 template<class X, class Y>
6 X* dyn_cast(Y *Val);
9 class Foo {
10 public:
11 template<typename T> T &getAs();
14 template <typename T, typename U, typename V>
15 V doSomething(T t, const U &u, V *v) { return V(); }
17 void f() {
18 std::sort(1, 2);
19 Foo().getAs<int>();
20 // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:%(line-2):8 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s
21 // CHECK-CC1: dyn_cast<<#class X#>>(<#Y *Val#>)
22 // CHECK-CC1: sort(<#RandomAccessIterator first#>, <#RandomAccessIterator last#>
23 // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:%(line-4):9 %s -o - | FileCheck -check-prefix=CHECK-CC2 %s
24 // CHECK-CC2: getAs<<#typename T#>>()
25 // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:%(line-6):22 %s -o - | FileCheck -check-prefix=CHECK-CC3 %s
26 // CHECK-CC3: [#V#]doSomething(<#T t#>, <#const U &u#>, <#V *v#>)