libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / pr110777.c
blob0c10590bcda87871dfb39b149c4e9a348031982b
1 /* { dg-do compile } */
2 /* { dg-options "-O3 -w" } */
4 void pm_message (int);
5 void _setjmp (void);
6 int *findOrAddBackgroundInPalette_palette_pnm;
7 static void findOrAddBackgroundInPalette(unsigned *paletteSizeP,
8 int *backgroundIndexP) {
9 if (*paletteSizeP) {
10 *backgroundIndexP = (*paletteSizeP)++;
11 pm_message(0);
13 pm_message(findOrAddBackgroundInPalette_palette_pnm[*backgroundIndexP]);
15 void computeColorMap(int *backgroundIndexP) {
16 unsigned paletteSize;
17 findOrAddBackgroundInPalette(&paletteSize, backgroundIndexP);
19 int main() {
20 unsigned backgroundIndex;
21 _setjmp();
22 computeColorMap(&backgroundIndex);