tinycc/tests
kbkpbot 36ff4f52b5
Some checks failed
build and test / test-x86_64-linux (push) Has been cancelled
build and test / test-x86_64-osx (push) Has been cancelled
build and test / test-aarch64-osx (push) Has been cancelled
build and test / test-x86-win32 (push) Has been cancelled
build and test / test-armv7-linux (push) Has been cancelled
build and test / test-aarch64-linux (push) Has been cancelled
build and test / test-riscv64-linux (push) Has been cancelled
Add GCC-style atomic builtins: __atomic_*_n
This commit adds GCC-compatible atomic builtins to stdatomic.h for
better compatibility with code relying on GCC's atomic primitives.

1. ​**​New Macros​**​:
   - `__atomic_compare_exchange_n`.
   - `__atomic_load_n`.
   - `__atomic_store_n`.

2. ​**​Motivation​**​:
   - Improves compatibility with codebases using GCC's atomic builtins
     directly.
   - Simplifies atomic operations by allowing direct value passing
     (instead of pointers), enhancing code readability.
   - Aligns TCC's atomic support closer to GCC/Clang for cross-compiler
     projects.

3. ​**​Testing​**​:
   - Verified with basic test cases (integer CAS, load/store) on x86.
   - Confirmed no regressions in existing atomic operations.

- This change does not affect existing C11 `atomic_*` APIs.
- Struct types are intentionally unsupported in `_n` variants due to
  complexity.
2025-04-19 08:05:27 +08:00
..
pp pp-expression numbers always long long 2025-03-26 20:36:33 +01:00
tests2 Add GCC-style atomic builtins: __atomic_*_n 2025-04-19 08:05:27 +08: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 Serveral updates 2021-01-12 18:06:23 +01:00
bug.c Allow const expr in builtin_frame_address/builtin_return_address 2023-01-16 08:37:47 +01:00
gcctestsuite.sh gcctestsuite: Make the script usable on more systems, skip some tests 2022-10-12 00:59:02 +02:00
libtcc_test_mt.c tccrun: review last changes 2024-02-19 17:45:44 +01:00
libtcc_test.c LIBTCCAPI tcc_relocate(s) : REMOVED 2nd argument 2024-02-09 13:38:27 +01:00
Makefile tccpe.c: never assume static system libtaries 2024-12-06 16:21:30 +01:00
tcctest.c tccelf.c: write section headers before sections 2024-10-13 23:55:32 +02: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