tinycc/tests
Cyan Ogilvie d5ecb52a71 tests: add test for x86_64 xor REX prefix bug in load()
When load() in x86_64-gen.c generates a zero constant for a 64-bit
register, it uses:

    o(0xc031 + REG_VALUE(r) * 0x900);

REG_VALUE(r) masks to (r & 7), losing bit 3, and no orex() call
emits the REX prefix needed for registers r8-r15.  For TREG_R11
(used by gcall_or_jmp for indirect calls), this emits
"xor %ebx,%ebx" (31 db) instead of "xor %r11d,%r11d" (45 31 db),
clobbering the wrong register.

The test compiles an indirect call through a null function pointer
((void(*)(void))0)() via libtcc, then inspects the generated machine
code for the incorrect encoding.
2026-04-16 10:42:16 -03:00
..
pp pp-expression numbers always long long 2025-03-26 20:36:33 +01:00
tests2 No more ; needed 2026-04-15 20:56:01 -07:00
42test.h tccpp: Allow computed include like 42.h 2016-12-15 17:47:10 +01:00
abitest.c LIBTCCAPI tcc_relocate(s) : REMOVED 2nd argument 2024-02-09 13:38:27 +01:00
arm-asm-testsuite.sh arm-asm: Add vcvt 2021-02-13 01:03:41 +01:00
asm-c-connect-1.c OpenBSD: testcases 2020-12-16 17:52:59 +01:00
asm-c-connect-2.c OpenBSD: testcases 2020-12-16 17:52:59 +01:00
asmtest.S x86asm: Add lzcnt/tzcnt support 2022-12-13 11:34:54 +01:00
boundtest.c Add bound check support for alloca on all targets 2025-11-29 07:54:28 +01:00
bug.c Allow const expr in builtin_frame_address/builtin_return_address 2023-01-16 08:37:47 +01:00
gcctestsuite.sh Update gcctestsuite 2025-08-03 10:35:58 +02:00
libtcc_debug.c Add support to debug libtcc code 2026-01-06 12:11:51 +01:00
libtcc_test_mt.c tccrun: review last changes 2024-02-19 17:45:44 +01:00
libtcc_test_xor_rex.c tests: add test for x86_64 xor REX prefix bug in load() 2026-04-16 10:42:16 -03:00
libtcc_test.c LIBTCCAPI tcc_relocate(s) : REMOVED 2nd argument 2024-02-09 13:38:27 +01:00
Makefile tests: add test for x86_64 xor REX prefix bug in load() 2026-04-16 10:42:16 -03:00
nostdlib_test.c Move -run -nostdlib code to lib directory 2025-12-15 14:45:11 +01:00
tcctest.c Fix clang macos 15 bug on arm64 in tests/tcctest.c 2025-12-17 19:54:22 +01:00
tcctest.h tccpp: Implement __BASE_FILE__ macro 2016-12-15 17:47:08 +01:00
testfp.c Remove misc. files 2016-10-01 20:27:41 +02:00
vla_test.c Improved variable length array support. 2013-04-27 22:58:52 +01:00