1*9880d681SAndroid Build Coastguard Worker; RUN: llc -march=arm64 -O0 -verify-machineinstrs < %s | FileCheck %s 2*9880d681SAndroid Build Coastguard Worker; RUN: llc -march=arm64 -O3 -verify-machineinstrs < %s | FileCheck %s 3*9880d681SAndroid Build Coastguard Worker 4*9880d681SAndroid Build Coastguard Worker@.str = private unnamed_addr constant [9 x i8] c"%lf %lu\0A\00", align 1 5*9880d681SAndroid Build Coastguard Worker@.str1 = private unnamed_addr constant [8 x i8] c"%lf %u\0A\00", align 1 6*9880d681SAndroid Build Coastguard Worker@.str2 = private unnamed_addr constant [8 x i8] c"%f %lu\0A\00", align 1 7*9880d681SAndroid Build Coastguard Worker@.str3 = private unnamed_addr constant [7 x i8] c"%f %u\0A\00", align 1 8*9880d681SAndroid Build Coastguard Worker 9*9880d681SAndroid Build Coastguard Workerdefine void @testDouble(double %d) ssp { 10*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: testDouble: 11*9880d681SAndroid Build Coastguard Worker; CHECK: fcvtzu x{{[0-9]+}}, d{{[0-9]+}} 12*9880d681SAndroid Build Coastguard Worker; CHECK: fcvtzu w{{[0-9]+}}, d{{[0-9]+}} 13*9880d681SAndroid Build Coastguard Workerentry: 14*9880d681SAndroid Build Coastguard Worker %d.addr = alloca double, align 8 15*9880d681SAndroid Build Coastguard Worker store double %d, double* %d.addr, align 8 16*9880d681SAndroid Build Coastguard Worker %0 = load double, double* %d.addr, align 8 17*9880d681SAndroid Build Coastguard Worker %1 = load double, double* %d.addr, align 8 18*9880d681SAndroid Build Coastguard Worker %conv = fptoui double %1 to i64 19*9880d681SAndroid Build Coastguard Worker %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i32 0, i32 0), double %0, i64 %conv) 20*9880d681SAndroid Build Coastguard Worker %2 = load double, double* %d.addr, align 8 21*9880d681SAndroid Build Coastguard Worker %3 = load double, double* %d.addr, align 8 22*9880d681SAndroid Build Coastguard Worker %conv1 = fptoui double %3 to i32 23*9880d681SAndroid Build Coastguard Worker %call2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str1, i32 0, i32 0), double %2, i32 %conv1) 24*9880d681SAndroid Build Coastguard Worker ret void 25*9880d681SAndroid Build Coastguard Worker} 26*9880d681SAndroid Build Coastguard Worker 27*9880d681SAndroid Build Coastguard Workerdeclare i32 @printf(i8*, ...) 28*9880d681SAndroid Build Coastguard Worker 29*9880d681SAndroid Build Coastguard Workerdefine void @testFloat(float %f) ssp { 30*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: testFloat: 31*9880d681SAndroid Build Coastguard Worker; CHECK: fcvtzu x{{[0-9]+}}, s{{[0-9]+}} 32*9880d681SAndroid Build Coastguard Worker; CHECK: fcvtzu w{{[0-9]+}}, s{{[0-9]+}} 33*9880d681SAndroid Build Coastguard Workerentry: 34*9880d681SAndroid Build Coastguard Worker %f.addr = alloca float, align 4 35*9880d681SAndroid Build Coastguard Worker store float %f, float* %f.addr, align 4 36*9880d681SAndroid Build Coastguard Worker %0 = load float, float* %f.addr, align 4 37*9880d681SAndroid Build Coastguard Worker %conv = fpext float %0 to double 38*9880d681SAndroid Build Coastguard Worker %1 = load float, float* %f.addr, align 4 39*9880d681SAndroid Build Coastguard Worker %conv1 = fptoui float %1 to i64 40*9880d681SAndroid Build Coastguard Worker %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str2, i32 0, i32 0), double %conv, i64 %conv1) 41*9880d681SAndroid Build Coastguard Worker %2 = load float, float* %f.addr, align 4 42*9880d681SAndroid Build Coastguard Worker %conv2 = fpext float %2 to double 43*9880d681SAndroid Build Coastguard Worker %3 = load float, float* %f.addr, align 4 44*9880d681SAndroid Build Coastguard Worker %conv3 = fptoui float %3 to i32 45*9880d681SAndroid Build Coastguard Worker %call4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str3, i32 0, i32 0), double %conv2, i32 %conv3) 46*9880d681SAndroid Build Coastguard Worker ret void 47*9880d681SAndroid Build Coastguard Worker} 48*9880d681SAndroid Build Coastguard Worker 49*9880d681SAndroid Build Coastguard Workerdefine i32 @main(i32 %argc, i8** %argv) ssp { 50*9880d681SAndroid Build Coastguard Workerentry: 51*9880d681SAndroid Build Coastguard Worker %retval = alloca i32, align 4 52*9880d681SAndroid Build Coastguard Worker %argc.addr = alloca i32, align 4 53*9880d681SAndroid Build Coastguard Worker %argv.addr = alloca i8**, align 8 54*9880d681SAndroid Build Coastguard Worker store i32 0, i32* %retval 55*9880d681SAndroid Build Coastguard Worker store i32 %argc, i32* %argc.addr, align 4 56*9880d681SAndroid Build Coastguard Worker store i8** %argv, i8*** %argv.addr, align 8 57*9880d681SAndroid Build Coastguard Worker call void @testDouble(double 1.159198e+01) 58*9880d681SAndroid Build Coastguard Worker call void @testFloat(float 0x40272F1800000000) 59*9880d681SAndroid Build Coastguard Worker ret i32 0 60*9880d681SAndroid Build Coastguard Worker} 61*9880d681SAndroid Build Coastguard Worker 62*9880d681SAndroid Build Coastguard Worker!llvm.module.flags = !{!0, !1, !2, !3} 63*9880d681SAndroid Build Coastguard Worker 64*9880d681SAndroid Build Coastguard Worker!0 = !{i32 1, !"Objective-C Version", i32 2} 65*9880d681SAndroid Build Coastguard Worker!1 = !{i32 1, !"Objective-C Image Info Version", i32 0} 66*9880d681SAndroid Build Coastguard Worker!2 = !{i32 1, !"Objective-C Image Info Section", !"__DATA, __objc_imageinfo, regular, no_dead_strip"} 67*9880d681SAndroid Build Coastguard Worker!3 = !{i32 4, !"Objective-C Garbage Collection", i32 0} 68