summaryrefslogtreecommitdiff
path: root/tests/math_assignment.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/math_assignment.c')
-rw-r--r--tests/math_assignment.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/math_assignment.c b/tests/math_assignment.c
new file mode 100644
index 0000000..abc295e
--- /dev/null
+++ b/tests/math_assignment.c
@@ -0,0 +1,22 @@
+int positive_test() {
+ int x = 0;
+ x += 5;//5
+ x -= 2;//3
+ x *= 9;//27 0x1b
+ x /= 2;//13 0xd
+
+ x %= 7;//6
+ x |= 8;//14 0xe
+ x ^= 3;//13 0xd
+
+ x += 2 << 3;//13 + 16 = 29 0xd
+ x -= 4 >> 1;//29 - 2 = 27 0x1b
+ x &= 7;//3
+ x <<= 5;//96 0x60
+ x >>= 5;//3
+ return x;
+}
+
+int main(){
+ return positive_test();
+}