[LLVMdev] llvm-as parse error

code_nf code_nf at sohu.com
Mon Apr 14 06:35:35 PDT 2008

I have just started to use llvm and confronted with a problem:
when I want to transform something very simple for name.ll to name.bc with llvm-as name.ll, some errors occured:

error: parse error, expecting `GLOBAL' or `CONSTANT' while reading token: 'target' 

btw, the name.ll file is as follows:

; ModuleID = 'tst.bc'
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"
target triple = "i686-pc-linux-gnu"
@.str = internal constant [13 x i8] c"hello world.\00" ; <[13 x i8]*> [#uses=1]
define i32 @main() nounwind  {
%tmp2 = tail call i32 @puts( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0) ) nounwind  ; <i32> [#uses=0]
ret i32 0
declare i32 @puts(i8*)

Thank you for your help.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080414/68f107fc/attachment.html>

More information about the llvm-dev mailing list