libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / pr92712-2.c
blob2710ff36cc1bca10a2c9bcab83c55611b19be8e9
1 /* PR tree-optimization/92712 */
2 /* { dg-do compile } */
3 /* { dg-options "-O2 -fno-ipa-icf -fdump-tree-optimized" } */
4 /* { dg-final { scan-tree-dump-times " = \[tv]_\[0-9]*\\\(D\\\) \\* \[tv]_\[0-9]*\\\(D\\\);" 7 "optimized" } } */
6 int
7 f1 (int t, int v)
9 int a = t - 1;
10 int b = a * v;
11 return b + v;
14 int
15 f2 (int t, int v)
17 int a = t - 1;
18 int b = a * v;
19 return v + b;
22 int
23 f3 (int t, int v)
25 int a = t + 1;
26 int b = a * v;
27 return b - v;
30 int
31 f4 (int t, int v)
33 int a = 1 - t;
34 int b = a * v;
35 return v - b;
38 int
39 f5 (int t, int v)
41 if (v == 0 || v == -1)
42 __builtin_unreachable ();
43 int a = t - 1U;
44 int b = a * v;
45 return b + v;
48 int
49 f6 (int t, int v)
51 if (v == 0 || v == -1)
52 __builtin_unreachable ();
53 int a = t - 1U;
54 int b = a * v;
55 return v + b;
58 int
59 f7 (int t, int v)
61 if (v == 0)
62 __builtin_unreachable ();
63 int a = t + 1U;
64 int b = a * v;
65 return b - v;