Hi, 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 IfEqual: call int %puts(sbyte* %cast1) br label %Done IfUnEqual: call int %puts(sbyte* %cast2) Done: 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. Thanks, Rahul
> I am trying to assemble a preety simple program, but the > assembler is giving parse errors: > IfUnEqual: > call int %puts(sbyte* %cast2) > Done:This is the problem. In LLVM, there are no fall through branches like this. You have to put an explicit "br label %Done" after the call.> Secondly, can I get the GCC frontend that generater LLVM code? > It would be much easier than writing assembly.Wow, I didn't realize you didn't have it yet. Sorry about that! I'll package it up this afternoon and email you. -Chris -- http://llvm.cs.uiuc.edu/ http://www.nondot.org/~sabre/Projects/
Maybe Matching Threads
- [GVN] same sequence of instructions in if and else branch
- [GVN] same sequence of instructions in if and else branch
- [GVN] same sequence of instructions in if and else branch
- [LLVMdev] Instruction Scheduling Itineraries
- adding infrequent date labels to x-axis