changeset 421:ffd17713a155

Add test for sign extension thing (commit 401).
author Rob Landley <rob@landley.net>
date Sun, 25 Feb 2007 22:18:49 -0500
parents e6ddaffce6a8
children dc756f766bfe
files tests/tcctest.c
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tests/tcctest.c	Thu Feb 22 15:17:33 2007 -0500
+++ b/tests/tcctest.c	Sun Feb 25 22:18:49 2007 -0500
@@ -1112,6 +1112,12 @@
 
     /* Cast float to bool */
     printf("%d\n", (_Bool) 0.1);
+
+    /* Cast with sign extension */
+    a = (short)0xf000;
+    printf("0x%x == 0xfffff000\n", a);
+    a = (signed char)0xf0f0;
+    printf("0x%x == 0xfffffff0\n", a);
 }
 
 /* initializers tests */