libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / pr84131.c
blobced2e5d93295da19cc027aadc0656138ee6db042
1 /* PR 94131 - ICE on printf with a VLA string and -fno-tree-ccp
2 -fno-tree-forwprop
3 { dg-do compile }
4 { dg-options "-O1 -fno-tree-ccp -fno-tree-forwprop" }
5 { dg-require-effective-target alloca } */
7 void rv1 (int n)
9 char a[n];
10 __INTPTR_TYPE__ i = (__INTPTR_TYPE__ )&a[0];
11 i &= 3;
13 __builtin_memset (a, '\0', sizeof a);
14 __builtin_printf ("%s", i ? &a[0] : "");
18 void sink (void*);
20 void rv2 (int n)
22 char a[n];
23 __INTPTR_TYPE__ i = (__INTPTR_TYPE__)&a[0];
24 i &= 3;
26 __builtin_memset (a, '\0', sizeof a);
27 __builtin_printf ("%s", i ? &a[0] : "");
29 sink (a);