Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CXX / dcl.decl / dcl.init / dcl.init.aggr / p7.cpp
blob22667ac14bb5245a0b5f35ea2156561cebac44c4
1 // RUN: %clang_cc1 -Wno-uninitialized -std=c++1y %s -verify
3 // expected-no-diagnostics
5 struct S { int a; const char *b; int c; int d = b[a]; };
6 constexpr S ss = { 1, "asdf" };
8 static_assert(ss.a == 1, "");
9 static_assert(ss.b[2] == 'd', "");
10 static_assert(ss.c == 0, "");
11 static_assert(ss.d == 's', "");
13 struct X { int i, j, k = 42; };
14 constexpr X a[] = { 1, 2, 3, 4, 5, 6 };
15 constexpr X b[2] = { { 1, 2, 3 }, { 4, 5, 6 } };
17 constexpr bool operator==(X a, X b) {
18 return a.i == b.i && a.j == b.j && a.k == b.k;
21 static_assert(sizeof(a) == sizeof(b), "");
22 static_assert(a[0] == b[0], "");
23 static_assert(a[1] == b[1], "");