2010-09-17 01:38:06 +00:00
|
|
|
; RUN: opt -instcombine -S < %s | FileCheck %s
|
|
|
|
|
2010-09-18 00:04:37 +00:00
|
|
|
; This test is inexplicably still failing, which suggests a
|
|
|
|
; bug in the host libm.
|
|
|
|
; XFAIL: arm-linux
|
|
|
|
|
2010-09-17 01:38:06 +00:00
|
|
|
; This shouldn't fold, because sin(inf) is invalid.
|
|
|
|
; CHECK: @foo
|
|
|
|
; CHECK: %t = call double @sin(double 0x7FF0000000000000)
|
|
|
|
define double @foo() {
|
|
|
|
%t = call double @sin(double 0x7FF0000000000000)
|
|
|
|
ret double %t
|
|
|
|
}
|
|
|
|
|
|
|
|
; This should fold.
|
|
|
|
; CHECK: @bar
|
2010-09-17 20:15:53 +00:00
|
|
|
; CHECK: ret double 0.0
|
2010-09-17 01:38:06 +00:00
|
|
|
define double @bar() {
|
2010-09-17 20:15:53 +00:00
|
|
|
%t = call double @sin(double 0.0)
|
2010-09-17 01:38:06 +00:00
|
|
|
ret double %t
|
|
|
|
}
|
|
|
|
|
|
|
|
declare double @sin(double)
|