brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · 28cbd33 Raw
33 lines · plain
1; RUN: llc %s -o - | FileCheck %s2target datalayout = "e-m:o-p:32:32-f64:32:64-f80:128-n8:16:32-S128"3target triple = "i386-apple-macosx10.5"4 5; Check that the merging of SP updates, when LEAs are involved, happen6; correctly.7; CHECK-LABEL: useLEA:8; CHECK: calll _realloc9; Make sure that the offset we get here is 8 + 16.10; We used to have 8 + 1 because we were not reading the right immediate form11; the LEA instruction.12; CHECK-NEXT: leal 24(%esp), %esp13define noalias ptr @useLEA(ptr nocapture %p, i32 %nbytes) #0 {14entry:15  %cmp = icmp slt i32 %nbytes, 016  br i1 %cmp, label %cond.end.3, label %cond.false17 18cond.false:                                       ; preds = %entry19  %tobool = icmp ne i32 %nbytes, 020  %cond = select i1 %tobool, i32 %nbytes, i32 121  %call = tail call ptr @realloc(ptr %p, i32 %cond)22  br label %cond.end.323 24cond.end.3:                                       ; preds = %entry, %cond.false25  %cond4 = phi ptr [ %call, %cond.false ], [ null, %entry ]26  ret ptr %cond427}28 29; Function Attrs: nounwind optsize30declare noalias ptr @realloc(ptr nocapture, i32)31 32attributes #0 = { nounwind optsize ssp "disable-tail-calls"="false" "frame-pointer"="all" "target-features"="+lea-sp" }33