diff options
Diffstat (limited to 'c_compiler/test')
-rw-r--r-- | c_compiler/test/in/Add.c | 2 | ||||
-rw-r--r-- | c_compiler/test/in/AddMult.c | 10 | ||||
-rw-r--r-- | c_compiler/test/in/Mult.c | 9 |
3 files changed, 21 insertions, 0 deletions
diff --git a/c_compiler/test/in/Add.c b/c_compiler/test/in/Add.c index 43e557e..b672efb 100644 --- a/c_compiler/test/in/Add.c +++ b/c_compiler/test/in/Add.c @@ -8,6 +8,8 @@ int main() { z = x + y + x + y - x; } } + + z = 2 + z - 2; return z; } diff --git a/c_compiler/test/in/AddMult.c b/c_compiler/test/in/AddMult.c new file mode 100644 index 0000000..a8fa566 --- /dev/null +++ b/c_compiler/test/in/AddMult.c @@ -0,0 +1,10 @@ +int main() { + int x; + int a = 8; + int b = 5; + int c = 7; + int d = 3; + x = a * b + c * d; + + return x; +} diff --git a/c_compiler/test/in/Mult.c b/c_compiler/test/in/Mult.c new file mode 100644 index 0000000..4855b54 --- /dev/null +++ b/c_compiler/test/in/Mult.c @@ -0,0 +1,9 @@ +int main() { + int x = 4*2; + int y = 7; + int z = 14 % 8; + + z = x * y * z / z * x; + + return z; +} |