diff options
| author | Uneven Prankster <unevenprankster@protonmail.com> | 2023-07-17 01:34:34 -0300 |
|---|---|---|
| committer | Uneven Prankster <unevenprankster@protonmail.com> | 2023-07-17 01:34:34 -0300 |
| commit | 88d82c6eaee88398af1de57cddca692a1f74b087 (patch) | |
| tree | df492c2002a1820959703f4f481172cceafeb0a1 /tinycc/tests/tests2/127_asm_goto.c | |
| parent | 111c133b939c15c57c90cd474d55e84928c6307a (diff) | |
Cleanup feels good! Big work coming up this week.
Diffstat (limited to 'tinycc/tests/tests2/127_asm_goto.c')
| -rw-r--r-- | tinycc/tests/tests2/127_asm_goto.c | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/tinycc/tests/tests2/127_asm_goto.c b/tinycc/tests/tests2/127_asm_goto.c deleted file mode 100644 index de631aa..0000000 --- a/tinycc/tests/tests2/127_asm_goto.c +++ /dev/null @@ -1,62 +0,0 @@ -static int simple_jump(void) -{ - asm goto ("jmp %l[label]" : : : : label); - return 0; -label: - return 1; -} - -static int three_way_jump(int val, int *addr) -{ - *addr = 42; - asm goto ("cmp $0, %1\n\t" - "jg %l[larger]\n\t" - "jl %l[smaller]\n\t" - "incl %0\n\t" - : "=m" (*addr) - : "r" (val) - : - : smaller, larger); - return 1; -smaller: - return 2; -larger: - return 3; -} - -static int another_jump(void) -{ - asm goto ("jmp %l[label]" : : : : label); - return 70; - /* Use the same label name as in simple_jump to check that - that doesn't confuse our C/ASM symbol tables */ -label: - return 71; -} - -extern int printf (const char *, ...); -int main(void) -{ - int i; - if (simple_jump () == 1) - printf ("simple_jump: okay\n"); - else - printf ("simple_jump: wrong\n"); - if (another_jump () == 71) - printf ("another_jump: okay\n"); - else - printf ("another_jump: wrong\n"); - if (three_way_jump(0, &i) == 1 && i == 43) - printf ("three_way_jump(0): okay\n"); - else - printf ("three_way_jump(0): wrong (i=%d)\n", i); - if (three_way_jump(1, &i) == 3 && i == 42) - printf ("three_way_jump(1): okay\n"); - else - printf ("three_way_jump(1): wrong (i=%d)\n", i); - if (three_way_jump(-1, &i) == 2 && i == 42) - printf ("three_way_jump(-1): okay\n"); - else - printf ("three_way_jump(-1): wrong (i=%d)\n", i); - return 0; -} |
