aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/expressions.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/expressions.sh b/tests/expressions.sh
index dadfade..8443774 100644
--- a/tests/expressions.sh
+++ b/tests/expressions.sh
@@ -184,6 +184,24 @@ int main() {
EOF
cat <<'EOF' > expected
+Result: -42
+Result: 0
+EOF
+test_diff <<'EOF'
+int printf(const char*, ...);
+
+typedef int foo;
+
+int main() {
+ int a = 42;
+ int b = -(int)a;
+ int c = !(foo)a;
+ printf("Result: %d\n", b);
+ printf("Result: %d\n", c);
+}
+EOF
+
+cat <<'EOF' > expected
Result: 130
EOF
test_diff <<'EOF'