Fix all tests that fail with -sanitize=return.
[official-gcc.git] / gcc / testsuite / g++.dg / tree-ssa / ssa-dse-3.C
blobfe8f309ac22988437e542532f60553c9460e6d16
1 /* { dg-do compile } */
2 /* { dg-options "-std=c++14 -O3 -fdump-tree-dse1-details" } */
4 #include <new>
5 #include <cstdint>
7 struct A
9     std::uint16_t a, b;
12 A* f(char* b) __attribute__((noinline));
14 A* f(char* b) {
15     auto a = new(b) A{};
16     a->a = 1;
17     a->b = 2;
18     return a;
21 int main() {
22     char b[sizeof(A)] alignas(A);
23     f(b);
27 /* { dg-final { scan-tree-dump "Deleted dead store: " "dse1" } } */