1 /* PR39565: Static variable leaves undefined symbol in object file.
2 Variables codestrs_4 and codestrs_8 should not be undefined,
3 when this program is compiled at -O2. As a basic sanity test,
4 verify that this program compiles into an executable and runs. */
7 /* { dg-options "-O2" } */
9 extern void abort (void);
10 extern void exit (int);
11 extern int strcmp (const char *, const char *);
13 static const union codestrs_t_4
{
15 char str_2
[sizeof ("Illegal opcode")];
18 } codestrs_4
= { {"Illegal opcode"} };
20 static const union codestrs_t_8
{
22 char str_12
[sizeof ("Integer divide by zero")];
25 } codestrs_8
= { {"Integer divide by zero"} };
30 const char *base
= ((void *)0);
34 case 4: base
= codestrs_4
.str
; break;
35 case 8: base
= codestrs_8
.str
; break;
43 if (strcmp (psiginfo (4), codestrs_4
.str
))
45 if (strcmp (psiginfo (8), codestrs_8
.str
))