libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / pr105676.c
blob077fc18a17f37a6a7a49b18ab52537a1d5040827
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -Wsuggest-attribute=pure" } */
4 __attribute__((const))
5 extern int do_expensive_calculation(void);
7 __attribute__((const))
8 int getval(void) /* { dg-bogus "candidate for attribute" } */
10 static int cache = -1;
11 if (cache == -1)
12 cache = do_expensive_calculation();
13 return cache;