[LLVMdev] Problems with the tools
Chris Lattner
sabre at nondot.org
Tue Jun 12 10:37:31 PDT 2007
On Tue, 12 Jun 2007, Andreas Rumpf wrote:
> I just built LLVM 2.0 on Windows with Visual C++ 2005. After a few tweaks, it produced several nice .exe files.
> I tried to compile a simple Hello-World program as given in the documentation:
The example was out of date, I fixed it:
http://llvm.org/docs/LangRef.html#modulestructure
Thanks,
-Chris
> --------------------------------------------------------------------------------------
>
> ; Declare the string constant as a global constant...
> %.LC0 = internal constant [13 x i8 ] c"hello world\0A\00" ; [13 x i8 ]*
>
> ; External declaration of the puts function
> declare i32 %puts(i8 *) ; i32(i8 *)*
>
> ; Definition of main function
> define i32 %main() { ; i32()*
> ; Convert [13x i8 ]* to i8 *...
> %cast210 = getelementptr [13 x i8 ]* %.LC0, i64 0, i64 0 ; i8 *
>
> ; Call puts function to write out the string to stdout...
> call i32 %puts(i8 * %cast210) ; i32
> ret i32 0
> }
>
> ----------------------------------------------------------------------------------------
>
> However this is all I get:
>
> C:\Eigenes\compiler\llvm-2.0\win32\release>llvm-as hellow.ll
> llvm-as: hellow.ll:2,0: hellow.ll:2: error: syntax error, unexpected INTERNAL, e
> xpecting TYPE while reading token: 'internal'
>
>
>
> _______________________________________________________________
> SMS schreiben mit WEB.DE FreeMail - einfach, schnell und
> kostenguenstig. Jetzt gleich testen! http://f.web.de/?mc=021192
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
-Chris
--
http://nondot.org/sabre/
http://llvm.org/
More information about the llvm-dev
mailing list