OLD | NEW |
1 //===- subzero/unittest/unittest/AssemblerX8632/TestUtil.h ------*- C++ -*-===// | 1 //===- subzero/unittest/unittest/AssemblerX8632/TestUtil.h ------*- C++ -*-===// |
2 // | 2 // |
3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
4 // | 4 // |
5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 // | 9 // |
10 // Utility classes for testing the X8632 Assembler. | 10 // Utility classes for testing the X8632 Assembler. |
(...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
722 size_t Size; | 722 size_t Size; |
723 }; | 723 }; |
724 | 724 |
725 // assemble created an AssembledTest with the jitted code. The first time | 725 // assemble created an AssembledTest with the jitted code. The first time |
726 // assemble is executed it will add the epilogue to the jitted code (which is | 726 // assemble is executed it will add the epilogue to the jitted code (which is |
727 // the reason why this method is not const qualified. | 727 // the reason why this method is not const qualified. |
728 AssembledTest assemble() { | 728 AssembledTest assemble() { |
729 if (NeedsEpilogue) { | 729 if (NeedsEpilogue) { |
730 addEpilogue(); | 730 addEpilogue(); |
731 } | 731 } |
| 732 NeedsEpilogue = false; |
732 | 733 |
733 NeedsEpilogue = false; | 734 for (auto *Fixup : assembler()->fixups()) { |
| 735 Fixup->emitOffset(assembler()); |
| 736 } |
| 737 |
734 return AssembledTest(codeBytes(), codeBytesSize(), NumAllocatedDwords); | 738 return AssembledTest(codeBytes(), codeBytesSize(), NumAllocatedDwords); |
735 } | 739 } |
736 | 740 |
737 // Allocates a new dword slot in the test's scratchpad area. | 741 // Allocates a new dword slot in the test's scratchpad area. |
738 uint32_t allocateDword() { return NumAllocatedDwords++; } | 742 uint32_t allocateDword() { return NumAllocatedDwords++; } |
739 | 743 |
740 // Allocates a new qword slot in the test's scratchpad area. | 744 // Allocates a new qword slot in the test's scratchpad area. |
741 uint32_t allocateQword() { | 745 uint32_t allocateQword() { |
742 uint32_t InitialDword = allocateDword(); | 746 uint32_t InitialDword = allocateDword(); |
743 allocateDword(); | 747 allocateDword(); |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
841 | 845 |
842 bool NeedsEpilogue; | 846 bool NeedsEpilogue; |
843 uint32_t NumAllocatedDwords; | 847 uint32_t NumAllocatedDwords; |
844 }; | 848 }; |
845 | 849 |
846 } // end of namespace Test | 850 } // end of namespace Test |
847 } // end of namespace X8632 | 851 } // end of namespace X8632 |
848 } // end of namespace Ice | 852 } // end of namespace Ice |
849 | 853 |
850 #endif // ASSEMBLERX8632_TESTUTIL_H_ | 854 #endif // ASSEMBLERX8632_TESTUTIL_H_ |
OLD | NEW |