[LLVMdev] .ll test cases for tail call optimization in test-suite

Evan Cheng evan.cheng at apple.com
Thu Oct 11 22:07:58 PDT 2007



On Oct 11, 2007, at 2:02 PM, Arnold Schwaighofer <arnold.schwaighofer at gmail.com 
 > wrote:

> In order to test the tail call optimization i created quite a few .ll
> files and added them to the SingleSource directory in the test-suite.
> For example llvm-test/SingleSource/Tailcall/tailcall1-2.ll.

Shouldn't these be dejagnu tests instead?

Evan

>
>
> Since i don't want opt to inline the tailcalls away :) i changed the  
> rules
> in the Makefile situated in the TailCall directory.
>
> I want to compare the output of a file compile with normal llc with a
> file compiled with llc -tailcallopt.
>
> So my SingleSource/TailCall/Makefile looks like the following:
> ----
> LEVEL = ../..
> include $(LEVEL)/Makefile.config
>
> #DISABLE_FOR_LLVM_PROGRAMS := 1
> PROGRAM_REQUIRED_TO_EXIT_OK := 1
>
> #REQUIRES_EH_SUPPORT := 1
>
> PROGRAMS_TO_TEST :=
> $(patsubst $(SourceDir)/%,%,$(basename $(wildcard $(SourceDir)/*.ll)))
>
> include $(LEVEL)/Makefile.programs
>
> .PRECIOUS: Output/%.linked.rll
>
>
> Output/%.linked.rbc: Output/%.bc
>        -cp -f $< $@
>
>
> # since there is no native use llc output
> Output/%.native: Output/%.bc Output/.dir
>        -$(LLC) < $< | $(CC) -x assembler - -o $@
>
> #
> # Compile a linked program to machine code with LLC.
> # use the unoptimized file %.bc not %.llvm.bc
> #
> $(PROGRAMS_TO_TEST:%=Output/%.llc.s): \
> Output/%.llc.s: Output/%.bc $(LLC)
>        -$(LLC) $(LLCFLAGS) -f $< -o $@
>
> $(PROGRAMS_TO_TEST:%=Output/%.llc-beta.s): \
> Output/%.llc-beta.s: Output/%.bc $(LLC)
>        -$(LLC) $(LLCFLAGS) -f $(LLCBETAOPTION) $< -o $@
>
> ----
>
> But that causes many of the following warnings when executiong make.
>
> Makefile:43: warning: overriding commands for target
> `Output/tailcall-struct-by-val.out-jit-beta'
>
> Is there a better way of doing what i want? Also should i really add
> those .ll test cases to the test-suite?
>
> regards arnold (obviously not a makefile guru)
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev



More information about the llvm-dev mailing list