~pali/+junk/llvm-toolchain-3.7

« back to all changes in this revision

Viewing changes to test/ExecutionEngine/frem.ll

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2015-07-15 17:51:08 UTC
  • Revision ID: package-import@ubuntu.com-20150715175108-l8mynwovkx4zx697
Tags: upstream-3.7~+rc2
ImportĀ upstreamĀ versionĀ 3.7~+rc2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
; 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
 
 
10
declare i32 @printf(i8* nocapture, ...) nounwind
 
11
declare i32 @fflush(i8*) nounwind
 
12
 
 
13
define i32 @main() {
 
14
  %flt = load float, float* @flt
 
15
  %float2 = frem float %flt, 5.0
 
16
  %double1 = fpext float %float2 to double
 
17
  call i32 (i8*, ...) @printf(i8* getelementptr ([18 x i8], [18 x i8]* @str, i32 0, i64 0), double %double1)
 
18
  call i32 @fflush(i8* null)
 
19
  ret i32 0
 
20
}
 
21
 
 
22
; CHECK: Double value: 2.0