xref: /llvm-project/llvm/test/CodeGen/X86/ipra-inline-asm.ll (revision 2de1e067360055b5fb17568dc474fbfd7c4b1ffb)
1; RUN: llc -enable-ipra -print-regusage -o /dev/null 2>&1 < %s | FileCheck %s
2
3; RUN: llc --stop-after=prologepilog -o - %s \
4; RUN: | llc -x=mir -enable-ipra -passes="module(require<reg-usage>,function(machine-function(reg-usage-collector)),print<reg-usage>)" -o /dev/null 2>&1 \
5; RUN: | FileCheck %s
6
7target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
8target triple = "x86_64-apple-macosx10.12.0"
9
10; Verify that bar does not clobber anything
11; CHECK-NOT: bar Clobbered Registers:{{.+}}
12; CHECK: bar Clobbered Registers:
13define void @bar() #0 {
14  ret void
15}
16
17; Verifies that inline assembly is correctly handled by giving a list of clobbered registers
18; CHECK: foo Clobbered Registers: $ah $al $ax $ch $cl $cx $di $dih $dil $eax $ecx $edi $hax $hcx $hdi $rax $rcx $rdi
19define void @foo() #0 {
20  call void asm sideeffect "", "~{eax},~{ecx},~{edi}"() #0
21  ret void
22}
23
24@llvm.used = appending global [2 x ptr] [ptr @foo, ptr @bar]
25
26attributes #0 = { nounwind }
27