1 #include <stdio.h> 2 3 int x; 4 int y; 5 6 __attribute__((weak)) foobar(void)7 void foobar (void) { y++; x++; } 8 main(void)9 int main (void) 10 { 11 foobar (); 12 if (y == 0) 13 { 14 if (x == -1) 15 printf ("OK\n"); 16 } 17 else 18 { 19 if (x == 1) 20 printf ("OK\n"); 21 } 22 return 0; 23 } 24