Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / OpenMP / crash-skipped-bodies-template-inst.cpp
blobc7ba432d5090ba7fb707fbab59a8dbd6ca548796
1 // RUN: not %clang_cc1 -fsyntax-only -std=c++14 -code-completion-at=%s:28:5 -fopenmp %s -o - 2>&1 | FileCheck %s
2 template <class T>
3 auto make_func() {
4 struct impl {
5 impl* func() {
6 int x;
7 if (x = 10) {
8 #pragma omp parallel
11 // Check that body of this function is actually skipped.
12 // CHECK-NOT: crash-skipped-bodies-template-inst.cpp:7:{{[0-9]+}}: warning: using the result of an assignment as a condition without parentheses
13 return this;
17 int x;
18 if (x = 10) {}
19 // Check that this function is not skipped.
20 // CHECK: crash-skipped-bodies-template-inst.cpp:18:9: warning: using the result of an assignment as a condition without parentheses
21 return impl();
24 void foo() {
25 []() {
26 make_func<int>();
28 // CHECK: COMPLETION: make_func : [#auto#]make_func<<#class T#>>()