mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 03:51:18 +00:00
24 lines
468 B
C
24 lines
468 B
C
// #target: macos-x64
|
|
module test;
|
|
import std::io;
|
|
fn void main()
|
|
{
|
|
ichar x = 23;
|
|
ichar y = 121;
|
|
int z1 = $$mul(x, y);
|
|
ichar z2 = $$div(y, x);
|
|
ichar z3 = $$mod(y, x);
|
|
int z4 = $$add(x, y);
|
|
int z5 = $$sub(x, y);
|
|
int z6 = $$neg(x);
|
|
io::printfn("%s %s %s %s %s %s", z1, z2, z3, z4, z5, z6);
|
|
}
|
|
|
|
/* #expect: test.ll
|
|
|
|
%emul = mul i8 %0, %1
|
|
%esdiv = sdiv i8 %2, %3
|
|
%eumod = srem i8 %4, %5
|
|
%eadd = add i8 %6, %7
|
|
%esub = sub i8 %8, %9
|
|
%eneg = sub i8 0, %10
|