59 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc < %s -mtriple=i686-- -relocation-model=static | FileCheck %s3 4@X = external dso_local global [0 x i32]5 6define void @foo() nounwind {7; CHECK-LABEL: foo:8; CHECK: # %bb.0: # %entry9; CHECK-NEXT: pushl %eax10; CHECK-NEXT: movl %esp, %eax11; CHECK-NEXT: pushl %eax12; CHECK-NEXT: calll frob@PLT13; CHECK-NEXT: addl $4, %esp14; CHECK-NEXT: leal X(%esp), %eax15; CHECK-NEXT: pushl %eax16; CHECK-NEXT: calll borf@PLT17; CHECK-NEXT: addl $4, %esp18; CHECK-NEXT: popl %eax19; CHECK-NEXT: retl20entry:21 %Y = alloca i3222 call void @frob(ptr %Y) nounwind23 %ctg2 = getelementptr i8, ptr %Y, i32 ptrtoint (ptr @X to i32)24 %0 = ptrtoint ptr %ctg2 to i3225 call void @borf(i32 %0) nounwind26 ret void27}28 29define void @bar(i32 %i) nounwind {30; CHECK-LABEL: bar:31; CHECK: # %bb.0: # %entry32; CHECK-NEXT: pushl %esi33; CHECK-NEXT: subl $40, %esp34; CHECK-NEXT: movl {{[0-9]+}}(%esp), %esi35; CHECK-NEXT: movl %esp, %eax36; CHECK-NEXT: pushl %eax37; CHECK-NEXT: calll frob@PLT38; CHECK-NEXT: addl $4, %esp39; CHECK-NEXT: leal X(%esp,%esi,4), %eax40; CHECK-NEXT: pushl %eax41; CHECK-NEXT: calll borf@PLT42; CHECK-NEXT: addl $44, %esp43; CHECK-NEXT: popl %esi44; CHECK-NEXT: retl45entry:46 %Y = alloca [10 x i32]47 call void @frob(ptr %Y) nounwind48 %0 = getelementptr [0 x i32], ptr @X, i32 0, i32 %i49 %1 = ptrtoint ptr %Y to i3250 %ctg2 = getelementptr i8, ptr %0, i32 %151 %2 = ptrtoint ptr %ctg2 to i3252 call void @borf(i32 %2) nounwind53 ret void54}55 56declare void @frob(ptr)57 58declare void @borf(i32)59