文件
Paze-C-CPP-Compiler/tests/tests2/61_integers.c
T
Paze AI 251ee470bf feat: Paze C Compiler - 完整改造自 tcc 0.9.28rc
- 所有 tcc 文件/内容/宏改名为 pcc (tcc.c->pcc.c, tccelf.c->pccelf.c, libtcc.c->libpcc.c 等)
- 支持架构: i386, x86_64, ARM, ARM64, RISC-V, C67
- 支持格式: PE, ELF, Mach-O, COFF
- 完整预处理、代码生成、链接器、调试信息
- 构建成功: pcc.exe (x86_64 Windows)
- 功能测试通过: 递归/结构体/浮点/switch/循环
- 自编译测试通过: pcc 可以编译自身
2026-08-16 13:30:01 +08:00

71 行
2.3 KiB
C

#include <stdio.h>
/* This was first introduced to test the ARM port */
#define UINT_MAX ((unsigned) -1)
int main()
{
printf("18/21=%u\n", 18/21);
printf("18%%21=%u\n", 18%21);
printf("41/21=%u\n", 41/21);
printf("41%%21=%u\n", 41%21);
printf("42/21=%u\n", 42/21);
printf("42%%21=%u\n", 42%21);
printf("43/21=%u\n", 43/21);
printf("43%%21=%u\n", 43%21);
printf("126/21=%u\n", 126/21);
printf("126%%21=%u\n", 126%21);
printf("131/21=%u\n", 131/21);
printf("131%%21=%u\n", 131%21);
printf("(UINT_MAX/2+3)/2=%u\n", (UINT_MAX/2+3)/2);
printf("(UINT_MAX/2+3)%%2=%u\n", (UINT_MAX/2+3)%2);
printf("18/-21=%u\n", 18/-21);
printf("18%%-21=%u\n", 18%-21);
printf("41/-21=%u\n", 41/-21);
printf("41%%-21=%u\n", 41%-21);
printf("42/-21=%u\n", 42/-21);
printf("42%%-21=%u\n", 42%-21);
printf("43/-21=%u\n", 43/-21);
printf("43%%-21=%u\n", 43%-21);
printf("126/-21=%u\n", 126/-21);
printf("126%%-21=%u\n", 126%-21);
printf("131/-21=%u\n", 131/-21);
printf("131%%-21=%u\n", 131%-21);
printf("(UINT_MAX/2+3)/-2=%u\n", (UINT_MAX/2+3)/-2);
printf("(UINT_MAX/2+3)%%-2=%u\n", (UINT_MAX/2+3)%-2);
printf("-18/21=%u\n", -18/21);
printf("-18%%21=%u\n", -18%21);
printf("-41/21=%u\n", -41/21);
printf("-41%%21=%u\n", -41%21);
printf("-42/21=%u\n", -42/21);
printf("-42%%21=%u\n", -42%21);
printf("-43/21=%u\n", -43/21);
printf("-43%%21=%u\n", -43%21);
printf("-126/21=%u\n", -126/21);
printf("-126%%21=%u\n", -126%21);
printf("-131/21=%u\n", -131/21);
printf("-131%%21=%u\n", -131%21);
printf("-(UINT_MAX/2+3)/2=%u\n", (0-(UINT_MAX/2+3))/2);
printf("-(UINT_MAX/2+3)%%2=%u\n", (0-(UINT_MAX/2+3))%2);
printf("-18/-21=%u\n", -18/-21);
printf("-18%%-21=%u\n", -18%-21);
printf("-41/-21=%u\n", -41/-21);
printf("-41%%-21=%u\n", -41%-21);
printf("-42/-21=%u\n", -42/-21);
printf("-42%%-21=%u\n", -42%-21);
printf("-43/-21=%u\n", -43/-21);
printf("-43%%-21=%u\n", -43%-21);
printf("-126/-21=%u\n", -126/-21);
printf("-126%%-21=%u\n", -126%-21);
printf("-131/-21=%u\n", -131/-21);
printf("-131%%-21=%u\n", -131%-21);
printf("-(UINT_MAX/2+3)/-2=%u\n", (0-(UINT_MAX/2+3))/-2);
printf("-(UINT_MAX/2+3)%%-2=%u\n", (0-(UINT_MAX/2+3))%-2);
return 0;
}