PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git] / gcc / testsuite / gcc.dg / 20050309-1.c
blob46b27f82e29c67751776e0a0ee7084704791eb14
1 /* This caused an ICE on s390 due to incorrect secondary
2 output reloads. */
4 /* { dg-do compile } */
5 /* { dg-require-profiling "-fprofile-generate" } */
6 /* { dg-options "-O2 -fprofile-generate" } */
8 void lookup ();
9 int hash ();
10 void error ();
12 char *
13 test(char *ret, int *counter, void *schema,
14 const char* name, const char *namespace,
15 void *node, int topLevel)
17 char buf[30];
18 int val;
20 if (counter == 0) return 0;
21 if (schema == 0) return 0;
22 if (name == 0) return 0;
24 __builtin_memset (ret, 0, 100);
25 lookup (schema, name, -1);
26 val = hash (schema, name, namespace, name, ret);
27 if (val == 0) return ret;
29 if (topLevel != 0)
31 error (1, 0, 0, node, "%s", name);
32 return 0;
35 __snprintf_chk (buf, 29, 1, 30, "#eCont %d", ++*counter);
36 val = hash (schema, name, buf, namespace, ret);
37 if (val == 0) return ret;
39 error (1, 0, 0, node, "%s", name);
40 return 0;