blob: 077fc18a17f37a6a7a49b18ab52537a1d5040827 [file] [log] [blame]
/* { dg-do compile } */
/* { dg-options "-O2 -Wsuggest-attribute=pure" } */
__attribute__((const))
extern int do_expensive_calculation(void);
__attribute__((const))
int getval(void) /* { dg-bogus "candidate for attribute" } */
{
static int cache = -1;
if (cache == -1)
cache = do_expensive_calculation();
return cache;
}