diff options
Diffstat (limited to 'backend/unittests/CodeGen/MachineIRBuilderTest.cpp')
| -rw-r--r-- | backend/unittests/CodeGen/MachineIRBuilderTest.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/backend/unittests/CodeGen/MachineIRBuilderTest.cpp b/backend/unittests/CodeGen/MachineIRBuilderTest.cpp index bda30b6..ba5e3db 100644 --- a/backend/unittests/CodeGen/MachineIRBuilderTest.cpp +++ b/backend/unittests/CodeGen/MachineIRBuilderTest.cpp @@ -356,6 +356,16 @@ void testImplicitAndMemoryValidation(TestContext &Context) { Function->allInstructions().size() == BeforeMissingMemory, "missing required MMO must fail before instruction allocation"); + rcc::StackObjectDesc StackSlot; + StackSlot.Size = 8; + StackSlot.Align = *rcc::Alignment::create(8); + auto FrameIndex = Function->frameInfo().createObject(StackSlot); + auto ForeignFrameIndex = OtherFunction->frameInfo().createObject(StackSlot); + Context.expect(FrameIndex && ForeignFrameIndex, + "memory validation stack objects must be created"); + if (!FrameIndex || !ForeignFrameIndex) + return; + auto LoadMemory = Function->createMemOperand(memoryDescription(rcc::MemoryAccessFlag::Load)); auto StoreMemory = Function->createMemOperand(memoryDescription(rcc::MemoryAccessFlag::Store)); auto ForeignMemory = |
