Compiling CMM tests with LLVM

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Compiling CMM tests with LLVM

Erik de Castro Lopo-34
Hi all,

I'm working on a minor change to CMM (#13442) and while writing the
tests realized that the CMM tests were only run with `-fasm` and not
with `-fllvm`. Furthermore other than running the test manually myself,
I could not figure out how to make it compile with LLVM.

My test (in my WIP local branch) is:

    testsuite/tests/codeGen/should_compile/T13442.cmm

and I updated the `all.T` in that same directory with the line:

    test('T13442', [cmm_src], compile, ['-dcmm-lint'])

Anyone have any clues as to how to make this compile with LLVM if
LLVM is available? I suspect it should probably be turned on for
the vast majority of the CMM tests.

Erik
--
----------------------------------------------------------------------
Erik de Castro Lopo
http://www.mega-nerd.com/
_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Compiling CMM tests with LLVM

Erik de Castro Lopo-34
Erik de Castro Lopo wrote:

> Hi all,
>
> I'm working on a minor change to CMM (#13442) and while writing the
> tests realized that the CMM tests were only run with `-fasm` and not
> with `-fllvm`. Furthermore other than running the test manually myself,
> I could not figure out how to make it compile with LLVM.
>
> My test (in my WIP local branch) is:
>
>     testsuite/tests/codeGen/should_compile/T13442.cmm
>
> and I updated the `all.T` in that same directory with the line:
>
>     test('T13442', [cmm_src], compile, ['-dcmm-lint'])
>
> Anyone have any clues as to how to make this compile with LLVM if
> LLVM is available? I suspect it should probably be turned on for
> the vast majority of the CMM tests.

Ok, I added the following function to `testlib.py`:

    def cmm_src_llvm( name, opts ):
        opts.only_ways = ['optllvm', 'llvm', 'debugllvm']
        opts.cmm_src = 1;

and changed my test set up to:

     test('T13442', [cmm_src, cmm_src_llvm], compile, ['-dcmm-lint'])

Would still be interested to know if this is the correct way and
if there is a better way.

Erik
--
----------------------------------------------------------------------
Erik de Castro Lopo
http://www.mega-nerd.com/
_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
Loading...