Oops, fixed #example3_hello_world
Of course, expansion \n is done by the C compiler, not the
printf() function...
Also fixed return type so function prototype matches the ret insn type.
--- a/LLVMExamples.st Mon Aug 03 20:47:52 2015 +0100
+++ b/LLVMExamples.st Mon Aug 03 21:25:56 2015 +0100
@@ -180,9 +180,9 @@
printfFunctionType := LLVMType function: #() returning: LLVMType int32.
printfFunction := module addFunctionNamed: 'printf' type: printfFunctionType.
- helloWorldString := module addGlobalNamed: '.str' value: (LLVMConstant string: 'Hello World!!\n').
+ helloWorldString := module addGlobalNamed: '.str' value: (LLVMConstant string: 'Hello World!!' , Character lf).
- mainFunctionType := LLVMType function: #() returning: LLVMType intptr.
+ mainFunctionType := LLVMType function: #() returning: LLVMType int32.
mainFunction := module addFunctionNamed: 'main' type: mainFunctionType.
mainFunctionEntry := mainFunction addBasicBlockNamed: 'entry'.