Adding and modifying CMakeLists.txt files to run unit tests under unittests/Target/* if the directory exists.
Adding basic unit test to check that code emitter object can be retrieved.
Details
Diff Detail
Event Timeline
lib/Target/Hexagon/MCTargetDesc/HexagonMCCodeEmitter.cpp | ||
---|---|---|
34 | Please add a period. | |
37 | No need for curly brackets, if the body is a single statement. | |
38 | Where are these magic numbers coming from? | |
73 | Reduce indent and remove curly brackets. if (MO.isReg()) return MCT.getRegisterInfo()->getEncodingValue(MO.getReg()); if (MO.isImm()) return static_cast<unsigned>(MO.getImm()); | |
unittests/Target/CMakeLists.txt | ||
6 | Please add newline. | |
unittests/Target/Hexagon/CMakeLists.txt | ||
11 | Please add newline. | |
unittests/Target/Hexagon/HexagonMCCodeEmitterTest.cpp | ||
54 | Please add newline. |
Applying formatting updates.
Adding enumeration to explain bitfield and constant for bitfield offsets.
Once the comments are address, I believe this is in good enough shape. Please upload a revised patch and I'll approve.
lib/Target/Hexagon/MCTargetDesc/HexagonMCCodeEmitter.cpp | ||
---|---|---|
11 | IIRC, I believe this should be added after the #includes. | |
42 | How about something like this? ParseField Field = HMI.isPacketEnd() ? ParseField::end : ParseField::last0; | |
unittests/CMakeLists.txt | ||
26 | Would this be better in unittests/MC/Target or unittests/MC/Hexagon (I prefer) ? The latter suggestion is more inline with how test/MC/Hexagon and test/CodeGen/Hexagon are laid out. | |
unittests/Target/Hexagon/HexagonMCCodeEmitterTest.cpp | ||
24 | assert(Target && "Expected to find a target."); | |
25 | Please use the Many more instances below. |
Looks good and I will submit this for you today. Chris Lattner can grant you check-in permission.
lib/Target/Hexagon/CMakeLists.txt | ||
---|---|---|
5 | Needs to be added to Makefile too? |
Needs to be added to Makefile too?