int x, y;
#define def(name, attr) \
__attribute__ ((noinline, noclone, attr)) \
int name() \
{ \
a: \
for (int i = 0; i < y; ++i) \
x=&x+!x!=&x==x; \
b: \
return (uintptr_t) &&b - (uintptr_t) &&a; \
}
def(fn, )
def(fn0, optimize(0));
def(fn1, optimize(1));
def(fn2, optimize(2));
def(fn3, optimize(3));
int O()
{
int s = fn();
if (s == fn0())
return 0;
if (s == fn1())
return 1;
if (s == fn2())
return 2;
if (s == fn3())
return 3;
return -1;
}
int main(int argc, char *argv[])
{
printf("-O%d\n", O());
return 0;
}