Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / Sema / caret-diags-complex-init.cpp
blob760ac44e99568da1511fe63059eedb662c1ccdb7
1 // RUN: not %clang_cc1 -std=c++11 -fsyntax-only -fno-diagnostics-show-line-numbers -fcaret-diagnostics-max-lines=5 %s 2>&1 | FileCheck %s -strict-whitespace
4 //CHECK: {{.*}}: error: excess elements in scalar initializer
5 //CHECK-NEXT: {{^}}_Complex double gz1 = {1, 2, 3};
6 //CHECK-NEXT: {{^}} ^{{$}}
7 _Complex double gz1 = {1, 2, 3};
9 //CHECK: {{.*}}: error: excess elements in scalar initializer
10 //CHECK-NEXT: {{^}}_Complex double dd = {1.0, 2.0, 3.0};
11 //CHECK-NEXT: {{^}} ^~~{{$}}
12 _Complex double dd = {1.0, 2.0, 3.0};
14 //CHECK: {{.*}}: error: excess elements in scalar initializer
15 //CHECK-NEXT: {{^}}_Complex float fd = {1.0, 2.0, 3.0, 4.0, 5.0};
16 //CHECK-NEXT: {{^}} ^~~{{$}}
17 _Complex float fd = {1.0, 2.0, 3.0, 4.0, 5.0};
19 //CHECK: {{.*}}: error: no viable conversion from 'foo' to 'double'
20 //CHECK-NEXT: {{^}}_Complex double ds = {f, 1.0, b};
21 //CHECK-NEXT: {{^}} ^{{$}}
22 struct foo{};
23 struct bar{};
25 foo f;
26 bar b;
27 _Complex double ds = {f, 1.0, b};
29 //CHECK: {{.*}}: error: no viable conversion from 'foo' to 'double'
30 //CHECK-NEXT: {{^}}_Complex double fg = {1.0, f};
31 //CHECK-NEXT: {{^}} ^{{$}}
32 _Complex double fg = {1.0, f};
35 //CHECK: {{.*}}: error: excess elements in scalar initializer
36 //CHECK-NEXT: {{^}}_Complex double gg = {1.0, 2.0, f};
37 //CHECK-NEXT: {{^}} ^{{$}}
38 //CHECK-NEXT: {{^}}6 errors generated.
39 _Complex double gg = {1.0, 2.0, f};