blob: aedaae38baac00910cfd78e980fc45f25887f9cc [file] [log] [blame]
Reid Kleckner016f6512014-11-13 23:32:52 +00001; LLI.exe used to crash on Windows\X86 when certain single precession
2; floating point intrinsics (defined as macros) are used.
3; This unit test guards against the failure.
4;
5; RUN: %lli %s | FileCheck %s
6
7@flt = internal global float 12.0e+0
8@str = internal constant [18 x i8] c"Double value: %f\0A\00"
9
10declare i32 @printf(i8* nocapture, ...) nounwind
Zachary Turner7994fa02015-02-18 19:32:28 +000011declare i32 @fflush(i8*) nounwind
Reid Kleckner016f6512014-11-13 23:32:52 +000012
13define i32 @main() {
David Blaikie7c9c6ed2015-02-27 21:17:42 +000014 %flt = load float, float* @flt
Reid Kleckner016f6512014-11-13 23:32:52 +000015 %float2 = frem float %flt, 5.0
16 %double1 = fpext float %float2 to double
David Blaikie32b845d2015-04-16 23:24:18 +000017 call i32 (i8*, ...) @printf(i8* getelementptr ([18 x i8], [18 x i8]* @str, i32 0, i64 0), double %double1)
Zachary Turner7994fa02015-02-18 19:32:28 +000018 call i32 @fflush(i8* null)
Reid Kleckner016f6512014-11-13 23:32:52 +000019 ret i32 0
20}
21
22; CHECK: Double value: 2.0