[LLVMdev] Problem with `as'

Rahul Joshi rujoshi at uiuc.edu
Tue Jun 3 14:17:01 PDT 2003


I am trying to assemble a preety simple program, but the
assembler is giving parse errors:

%.LC0 = internal constant [17 x sbyte] c"Hello World %d \0A\00"
%.LC1 = internal constant [17 x sbyte] c"yyyyyyyyyyyyyyy\0a\00"

declare int "puts"(sbyte*)

int "main"() {
	%cast1 = getelementptr [17 x sbyte]* %.LC0, long 0, long 0
	%cast2 = getelementptr [17 x sbyte]* %.LC1, long 0, long 0
	%result = seteq int 5, 6

	br bool %result, label %IfEqual, label %IfUnEqual
	call int %puts(sbyte* %cast1)
	br label %Done
	call int %puts(sbyte* %cast2)
	ret int 0

The assembler says:
as: hello.ll:17: parse error, unexpected LABELSTR
hello.ll:17:  while reading token: 'Done'

What am I missing?

Secondly, can I get the GCC frontend that generater LLVM code?
It would be much easier than writing assembly.


More information about the llvm-dev mailing list