1; REQUIRES: asserts
2; RUN: llc -verify-machineinstrs -mtriple=x86_64-apple-darwin -debug -o /dev/null < %s 2>&1 | FileCheck %s
3
4; We need to make sure that rematerialization into a physical register marks the
5; super- or sub-register as dead after this rematerialization since only the
6; original register is actually used later. Largely irrelevant for a trivial
7; example like this, since EAX is never used again, but easy to test.
8
9define i8 @test_remat() {
10  ret i8 0
11; CHECK: REGISTER COALESCING
12; CHECK: Remat: %EAX<def,dead> = MOV32r0 %EFLAGS<imp-def,dead>, %AL<imp-def>
13}
14
15; On the other hand, if it's already the correct width, we really shouldn't be
16; marking the definition register as dead.
17
18define i32 @test_remat32() {
19  ret i32 0
20; CHECK: REGISTER COALESCING
21; CHECK: Remat: %EAX<def> = MOV32r0 %EFLAGS<imp-def,dead>
22}
23
24