libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / pr95853.c
blobfdd3c30c45699ec0b43e34a0e4c80d289857d74d
1 /* PR tree-optimization/95853 */
2 /* { dg-do compile } */
3 /* { dg-options "-O2 -fdump-tree-widening_mul" } */
5 #if __SIZEOF_INT128__
6 typedef __uint128_t W;
7 typedef unsigned long long T;
8 #else
9 typedef unsigned long long W;
10 typedef unsigned int T;
11 #endif
13 struct S { int p; T r; };
15 struct S
16 foo (T x, T y)
18 W z = (W) x + y;
19 return (struct S) { z > ~(T) 0, (T) z };
22 struct S
23 bar (T x)
25 W z = (W) x + 132;
26 return (struct S) { z > ~(T) 0, (T) z };
29 struct S
30 baz (T x, unsigned short y)
32 W z = (W) x + y;
33 return (struct S) { z > ~(T) 0, (T) z };
36 struct S
37 qux (unsigned short x, T y)
39 W z = (W) x + y;
40 return (struct S) { z > ~(T) 0, (T) z };
43 struct S
44 corge (T x, T y)
46 T w = x + y;
47 W z = (W) x + y;
48 return (struct S) { z > ~(T) 0, w };
51 struct S
52 garple (T x, T y)
54 W z = (W) x + y;
55 T w = x + y;
56 return (struct S) { z > ~(T) 0, w };
59 /* { dg-final { scan-tree-dump-times "ADD_OVERFLOW" 6 "widening_mul" { target { i?86-*-* x86_64-*-* } } } } */