From cba8c5fe317bcad85d0bebb7aa68e52353f54916 Mon Sep 17 00:00:00 2001 From: Alex Lorenz Date: Thu, 6 Aug 2015 23:57:04 +0000 Subject: MIR Serialization: Fix serialization of unnamed IR block references. The block address machine operands can reference IR blocks in other functions. This commit fixes a bug where the references to unnamed IR blocks in other functions weren't serialized correctly. llvm-svn: 244299 --- .../CodeGen/MIR/X86/block-address-operands.mir | 23 +++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'llvm/test/CodeGen') diff --git a/llvm/test/CodeGen/MIR/X86/block-address-operands.mir b/llvm/test/CodeGen/MIR/X86/block-address-operands.mir index c96720d3559..67e298e4932 100644 --- a/llvm/test/CodeGen/MIR/X86/block-address-operands.mir +++ b/llvm/test/CodeGen/MIR/X86/block-address-operands.mir @@ -26,6 +26,12 @@ ret void } + define void @slot_in_other_function(i8** %addr) { + entry: + store volatile i8* blockaddress(@test3, %0), i8** %addr + ret void + } + define void @test3() { entry: store volatile i8* blockaddress(@test3, %0), i8** @addr @@ -81,6 +87,20 @@ body: - RETQ ... --- +name: slot_in_other_function +tracksRegLiveness: true +body: + - id: 0 + name: entry + liveins: [ '%rdi' ] + instructions: +# CHECK: name: slot_in_other_function +# CHECK: %rax = LEA64r %rip, 1, _, blockaddress(@test3, %ir-block.0), _ + - '%rax = LEA64r %rip, 1, _, blockaddress(@test3, %ir-block.0), _' + - 'MOV64mr killed %rdi, 1, _, 0, _, killed %rax' + - RETQ +... +--- name: test3 tracksRegLiveness: true body: @@ -88,7 +108,8 @@ body: name: entry successors: [ '%bb.1' ] instructions: - # CHECK: %rax = LEA64r %rip, 1, _, blockaddress(@test3, %ir-block.0), _ +# CHECK: name: test3 +# CHECK: %rax = LEA64r %rip, 1, _, blockaddress(@test3, %ir-block.0), _ - '%rax = LEA64r %rip, 1, _, blockaddress(@test3, %ir-block.0), _' - 'MOV64mr %rip, 1, _, @addr, _, killed %rax' - 'JMP64m %rip, 1, _, @addr, _' -- cgit v1.2.3