diff options
| author | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-06-08 17:10:31 +0800 |
|---|---|---|
| committer | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-06-08 17:10:31 +0800 |
| commit | 72af0dedf9e18911da65b9a5c4906689e868d9fc (patch) | |
| tree | 2ecbad93f96ab8ad7e26dc02cd02d802f853ab97 /rcc-legacy/tests/functional/div_constant.sy | |
| parent | 8faf6d290d6703b1775e0ad7a8928a4ebea4b11b (diff) | |
| download | rcc-project-72af0dedf9e18911da65b9a5c4906689e868d9fc.tar.gz rcc-project-72af0dedf9e18911da65b9a5c4906689e868d9fc.tar.xz | |
[legacy] Add functional and performance test suites
Diffstat (limited to 'rcc-legacy/tests/functional/div_constant.sy')
| -rw-r--r-- | rcc-legacy/tests/functional/div_constant.sy | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/rcc-legacy/tests/functional/div_constant.sy b/rcc-legacy/tests/functional/div_constant.sy new file mode 100644 index 0000000..bea3fbf --- /dev/null +++ b/rcc-legacy/tests/functional/div_constant.sy @@ -0,0 +1,31 @@ +int main() { + int a[20]; + int n = getarray(a); + int i = 0; + while (i < n) { + putint(a[i] / 1); putch(10); + putint(a[i] / 3); putch(10); + putint(a[i] / 6); putch(10); + putint(a[i] / 7); putch(10); + putint(a[i] / 14); putch(10); + putint(a[i] / 31); putch(10); + putint(a[i] / 641); putch(10); + putint(a[i] / 0x7FFFFFFF); putch(10); + putint(a[i] / -2147483648); putch(10); + // bitset1 + putint(a[i] / 1000000007); putch(10); + // power of two for positive integers + if (a[i] > 0) { + putint(a[i] / 2); putch(10); + putint(a[i] / 4); putch(10); + putint(a[i] / 16); putch(10); + putint(a[i] / 32); putch(10); + putint(a[i] / 1024); putch(10); + putint(a[i] / 65536); putch(10); + putint(a[i] / 1048576); putch(10); + } + putch(10); + i = i + 1; + } + return 0; +}
\ No newline at end of file |
