1 static int simple_jump(void)
3 asm goto ("jmp %l[label]" : : : : label
);
9 static int three_way_jump(int val
, int *addr
)
12 asm goto ("cmp $0, %1\n\t"
27 static int another_jump(void)
29 asm goto ("jmp %l[label]" : : : : label
);
31 /* Use the same label name as in simple_jump to check that
32 that doesn't confuse our C/ASM symbol tables */
37 extern int printf (const char *, ...);
41 if (simple_jump () == 1)
42 printf ("simple_jump: okay\n");
44 printf ("simple_jump: wrong\n");
45 if (another_jump () == 71)
46 printf ("another_jump: okay\n");
48 printf ("another_jump: wrong\n");
49 if (three_way_jump(0, &i
) == 1 && i
== 43)
50 printf ("three_way_jump(0): okay\n");
52 printf ("three_way_jump(0): wrong (i=%d)\n", i
);
53 if (three_way_jump(1, &i
) == 3 && i
== 42)
54 printf ("three_way_jump(1): okay\n");
56 printf ("three_way_jump(1): wrong (i=%d)\n", i
);
57 if (three_way_jump(-1, &i
) == 2 && i
== 42)
58 printf ("three_way_jump(-1): okay\n");
60 printf ("three_way_jump(-1): wrong (i=%d)\n", i
);