on master help sign in
Merge pull request #1549 from fatho/fix/master/c-codegen-closing-parenthesis
4694a36Edwin Brady
src/IRTS/CodegenC.hs+1−1
@@ -438,7 +438,7 @@ doOp v (LSExt (ITFixed from) ITChar) [x]
438doOp v (LSExt (ITFixed from) (ITFixed to)) [x]
438doOp v (LSExt (ITFixed from) (ITFixed to)) [x]
439 | nativeTyWidth from < nativeTyWidth to = bitCoerce v "S" from to x
439 | nativeTyWidth from < nativeTyWidth to = bitCoerce v "S" from to x
440doOp v (LZExt ITNative (ITFixed to)) [x]
440doOp v (LZExt ITNative (ITFixed to)) [x]
441− = v ++ "idris_b" ++ show (nativeTyWidth to) ++ "const(vm, (uintptr_t)GETINT(" ++ creg x ++ ")"
441+ = v ++ "idris_b" ++ show (nativeTyWidth to) ++ "const(vm, (uintptr_t)GETINT(" ++ creg x ++ "))"
442doOp v (LZExt ITChar (ITFixed to)) [x]
442doOp v (LZExt ITChar (ITFixed to)) [x]
443 = doOp v (LZExt ITNative (ITFixed to)) [x]
443 = doOp v (LZExt ITNative (ITFixed to)) [x]
444doOp v (LZExt (ITFixed from) ITNative) [x]
444doOp v (LZExt (ITFixed from) ITNative) [x]
test/reg052/expectednew file+1
@@ -0,0 +1 @@
1+42
test/reg052/reg052.idrnew file+8
@@ -0,0 +1,8 @@
1+impure_op : Bits64 -> IO Bits64
2+impure_op foo = return $ foo + 1
3+
4+impure_int : IO Int
5+impure_int = return 41
6+
7+main : IO ()
8+main = impure_int >>= impure_op . prim__zextInt_B64 >>= print
test/reg052/runnew file+4
@@ -0,0 +1,4 @@
1+#!/usr/bin/env bash
2+idris $@ -o reg052 reg052.idr
3+./reg052
4+rm -f reg052 *.ibc