@@ -388,6 +388,10 @@ cgExpr (SOp fn args) = do
388388 Nothing -> return Nothing
389389cgExpr SNothing = return . Just . ConstantOperand $ nullValue
390390cgExpr (SError msg) = do -- TODO: Print message
391+ str <- addGlobal' (ArrayType (2 + fromIntegral (length msg)) (IntegerType 8))
392+ (cgConst' (TT.Str (msg ++ "\n")))
393+ inst' $ simpleCall "putStr" [ConstantOperand $ C.GetElementPtr True str [ C.Int 32 0
394+ , C.Int 32 0]]
391395 inst' $ Call { isTailCall = True
392396 , callingConvention = CC.C
393397 , returnAttributes = []