comparison gcc/testsuite/gcc.dg/strlenopt-94.c @ 152:2b5abeee2509

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents
children
comparison
equal deleted inserted replaced
145:1830386684a0 152:2b5abeee2509
1 /* PR tree-optimization/93982 - Assignment incorrectly omitted by
2 -foptimize-strlen
3 { dg-do run }
4 { dg-options "-O2 -Wall" } */
5
6 struct A { const char **a; };
7 const char *buf[5];
8
9 __attribute__((noipa)) struct A
10 foo (char *p)
11 {
12 struct A r = { (const char **) p };
13 r.a[0] = "12345678";
14 r.a[1] = "";
15 r.a[2] = "";
16 r.a[3] = "";
17 r.a[4] = "";
18 return r;
19 }
20
21 int
22 main ()
23 {
24 struct A r = foo ((char *) &buf[0]);
25 if (!r.a[1] || r.a[1][0] != '\0')
26 __builtin_abort ();
27 return 0;
28 }