libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / uninit-pr61112.c
blobd8f9c80291a9642d3c6f471ac3df0ea032455b7f
1 /* PR tree-optimization/61112 - repeated conditional triggers false-positive
2 -Wmaybe-uninitialized warning
3 { dg-do compile }
4 { dg-options "-O2 -Wall" } */
6 int p;
8 void foo_c0 (int x, int y, int z)
10 int w;
11 if (x)
12 w = z;
13 if (y)
14 w = __LINE__;
16 if (x || y)
17 p = w; // { dg-bogus "-Wmaybe-uninitialized" }
21 void foo_c5_1_1 (int x, int y, int z, int a)
23 int w;
24 if (x)
25 w = z;
26 if (y)
27 w = __LINE__;
28 if (a)
29 w = __LINE__;
31 if (x || y || a)
32 p = w;
35 void foo_c5_1_2 (int x, int y, int z, int a)
37 int w;
38 if (x)
39 w = z;
40 if (y)
41 w = __LINE__;
42 if (a)
43 w = __LINE__;
45 if (x || a || y)
46 p = w;
49 void foo_c5_1_3 (int x, int y, int z, int a)
51 int w;
52 if (x)
53 w = z;
54 if (y)
55 w = __LINE__;
56 if (a)
57 w = __LINE__;
59 if (a || x || y)
60 p = w;
63 void foo_c5_2 (int x, int y, int z, int a)
65 int w;
66 if (x)
67 w = __LINE__;
68 if (y)
69 w = z;
70 if (a)
71 w = __LINE__;
73 if (x || y || a)
74 p = w; // { dg-bogus "-Wmaybe-uninitialized" }
77 void foo_c5_3 (int x, int y, int z, int a)
79 int w;
80 if (x)
81 w = __LINE__;
82 if (y)
83 w = __LINE__;
84 if (a)
85 w = z;
87 if (x || y || a)
88 p = w; // { dg-bogus "-Wmaybe-uninitialized" }