aboutsummaryrefslogtreecommitdiff
path: root/src/cljcc/lexer.clj
diff options
context:
space:
mode:
Diffstat (limited to 'src/cljcc/lexer.clj')
-rw-r--r--src/cljcc/lexer.clj23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/cljcc/lexer.clj b/src/cljcc/lexer.clj
index d4e20d3..ef4235f 100644
--- a/src/cljcc/lexer.clj
+++ b/src/cljcc/lexer.clj
@@ -67,12 +67,31 @@
slurp
lex)
- (lex "int x = 100;")
+ (lex "int x = 100l;")
+
+ (lex "
+ if (!sign_extend(10, 10l)) {
+ return 1;
+ }
+")
+
(lex
"
int main(void) {
- return 2- -1;
+ if (!sign_extend(10, 10l)) {
+ return 1;
+ }
+
+ if (!sign_extend(-10, -10l)) {
+ return 2;
+ }
+
+ long l = (long) 100;
+ if (l != 100l) {
+ return 3;
+ }
+ return 0;
}
")