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 | ||
---|---|---|
35 | Please add a period. | |
38 | No need for curly brackets, if the body is a single statement. | |
39 | Where are these magic numbers coming from? | |
74 | 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 ↗ | (On Diff #14167) | Please add newline. |
unittests/Target/Hexagon/CMakeLists.txt | ||
11 ↗ | (On Diff #14167) | Please add newline. |
unittests/Target/Hexagon/HexagonMCCodeEmitterTest.cpp | ||
54 ↗ | (On Diff #14167) | 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 ↗ | (On Diff #14185) | 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 | ||
23 ↗ | (On Diff #14185) | assert(Target && "Expected to find a target."); |
24 ↗ | (On Diff #14185) | 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?