avr-llvm / llvm

[MERGED UPSTREAM] AVR backend for the LLVM compiler library
220 stars 21 forks source link

#121 - added arduino libs and test for blink #122

Closed 4ntoine closed 9 years ago

4ntoine commented 9 years ago

This is not a complete test to build .hex for blink and it requires linking. But for now it can be used as integration-test for arduino

agnat commented 9 years ago

screen shot 2015-06-14 at 22 57 21

lol

Which part of "reduction" don't you understand?

-1. This is not helpful.

dylanmckay commented 9 years ago

Hey Anton,

Good effort, but it is unreasonable to include the entire Arduino test suite (38,000 extra lines!) in AVR-LLVM.

RandomInsano commented 9 years ago

Can I just plunk it into to Travis stuff during testing instead of including it? I'm already sucking down all of LLVM for Clang (still need to finish it!)

dylanmckay commented 9 years ago

That's a good idea. It wouldn't be worth it right now as it doesn't pass, but it would be good to do in the future.

4ntoine commented 9 years ago

Hey, I don't think it's unreasonable. It's high - level integration test and it should contain everything needed to get final hex. We could split it into hundreds of small unit tests but then we will do pretty the same but in lots of steps and files.

I can see some avr tests but they do not display the overall progress unfortunately. .

Also I don't think 17mb of disk space is a problem for anybody nowadays. 15 Июн 2015 г. 7:16 пользователь "Dylan McKay" notifications@github.com написал:

That's a good idea. It wouldn't be worth it right now as it doesn't pass, but it would be good to do in the future.

— Reply to this email directly or view it on GitHub https://github.com/avr-llvm/llvm/pull/122#issuecomment-111900988.

dylanmckay commented 9 years ago

I can see your logic, but the problem is that simply building Arduino is no substitute to real unit tests. At first glance, building Arduino may seem like a good indicator of AVR-LLVM correctness - but it is not. We are not far away from building the library without errors, but this in no way means that we are generating correct code.

This is almost the equivalent of building all of our unit tests but without checking where the output is what is expected. It is merely an exercise in whether any assertion errors are hit during CodeGen. This is useful, however it does not belong in the main LLVM repo (and if we ever wanted to become a part of LLVM master).

It also adds 38,000 lines of code to test a code base of ~10,000 lines.

It also requires the presence of a C++ compiler (which is not present in a plain LLVM build, for which these tests are supposed to be for), and perhaps other tools (such as a linker, which would also require AVR-GCC to test).

I believe that hundreds of small unit tests are a better alternative, because it allows us to properly verify the backend. If the tests fail, we know what is wrong just be checking what test failed.

I believe there is an official LLVM repository which solely exists for C/C++ clang/LLVM tests. It would be a decent idea to fork it and add AVR tests, and perhaps make travis run it.

4ntoine commented 9 years ago

Ok, no problem.

2015-06-15 11:13 GMT+05:00 Dylan McKay notifications@github.com:

I can see your logic, but the problem is that simply building Arduino is no substitute to real unit tests. At first glance, building Arduino may seem like a good indicator of AVR-LLVM correctness - but it is not. We are not far away from building the library without errors, but this in no way means that we are generating correct code.

This is almost the equivalent of building all of our unit tests but without checking where the output is what is expected. It is merely an exercise in whether any assertion errors are hit during CodeGen. This is useful, however it does not belong in the main LLVM repo (and if we ever wanted to become a part of LLVM master).

It also adds 38,000 lines of code to test a code base of ~10,000 lines.

It also requires the presence of a C++ compiler (which is not present in a plan LLVM build, for which these tests are supposed to be for), and perhaps other tools (such as a linker, which would also require AVR-GCC to test).

I believe that hundreds of small unit tests are a better alternative, because it allows us to properly verify the backend. If the tests fail, we know what is wrong just be checking what test failed.

I believe there is an official LLVM repository which solely exists for C/C++ clang/LLVM tests. It would be a decent idea to fork it and add AVR tests, and perhaps make travis run it.

— Reply to this email directly or view it on GitHub https://github.com/avr-llvm/llvm/pull/122#issuecomment-111940949.