93 lines · plain
1; RUN: opt < %s -passes=instcombine -S -mtriple=systemz-unknown | FileCheck %s2;3; Check that i32 arguments to generated libcalls have the proper extension4; attributes.5 6 7declare double @exp2(double)8declare float @exp2f(float)9declare fp128 @exp2l(fp128)10 11define double @fun1(i32 %x) {12; CHECK-LABEL: @fun113; CHECK: call double @ldexp14 %conv = sitofp i32 %x to double15 %ret = call double @exp2(double %conv)16 ret double %ret17}18 19define float @fun2(i32 %x) {20; CHECK-LABEL: @fun221; CHECK: call float @ldexpf22 %conv = sitofp i32 %x to float23 %ret = call float @exp2f(float %conv)24 ret float %ret25}26 27define fp128 @fun3(i8 zeroext %x) {28; CHECK-LABEL: @fun329; CHECK: call fp128 @ldexpl30 %conv = uitofp i8 %x to fp12831 %ret = call fp128 @exp2l(fp128 %conv)32 ret fp128 %ret33}34 35@a = common global [60 x i8] zeroinitializer, align 136@b = common global [60 x i8] zeroinitializer, align 137declare ptr @__memccpy_chk(ptr, ptr, i32, i64, i64)38define ptr @fun4() {39; CHECK-LABEL: @fun440; CHECK: call ptr @memccpy41 %ret = call ptr @__memccpy_chk(ptr @a, ptr @b, i32 0, i64 60, i64 -1)42 ret ptr %ret43}44 45%FILE = type { }46@A = constant [2 x i8] c"A\00"47declare i32 @fputs(ptr, ptr)48define void @fun5(ptr %fp) {49; CHECK-LABEL: @fun550; CHECK: call i32 @fputc51 call i32 @fputs(ptr @A, ptr %fp)52 ret void53}54 55@empty = constant [1 x i8] zeroinitializer56declare i32 @puts(ptr)57define void @fun6() {58; CHECK-LABEL: @fun659; CHECK: call i32 @putchar60 call i32 @puts(ptr @empty)61 ret void62}63 64@.str1 = private constant [2 x i8] c"a\00"65declare ptr @strstr(ptr, ptr)66define ptr @fun7(ptr %str) {67; CHECK-LABEL: @fun768; CHECK: call ptr @strchr69 %ret = call ptr @strstr(ptr %str, ptr @.str1)70 ret ptr %ret71}72 73; CHECK: declare ptr @strchr(ptr, i32 signext)74 75@hello = constant [14 x i8] c"hello world\5Cn\00"76@chp = global ptr zeroinitializer77declare ptr @strchr(ptr, i32)78define void @fun8(i32 %chr) {79; CHECK-LABEL: @fun880; CHECK: call ptr @memchr81 %dst = call ptr @strchr(ptr @hello, i32 %chr)82 store ptr %dst, ptr @chp83 ret void84}85 86; CHECK: declare double @ldexp(double, i32 signext)87; CHECK: declare float @ldexpf(float, i32 signext)88; CHECK: declare fp128 @ldexpl(fp128, i32 signext)89; CHECK: declare ptr @memccpy(ptr noalias writeonly, ptr noalias readonly captures(none), i32 signext, i64)90; CHECK: declare noundef i32 @fputc(i32 noundef signext, ptr noundef captures(none))91; CHECK: declare noundef i32 @putchar(i32 noundef signext)92; CHECK: declare ptr @memchr(ptr, i32 signext, i64)93