2010-09-17 09:38:06 +08:00
|
|
|
; RUN: opt -instcombine -S < %s | FileCheck %s
|
|
|
|
|
|
|
|
; 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-18 04:15:53 +08:00
|
|
|
; CHECK: ret double 0.0
|
2010-09-17 09:38:06 +08:00
|
|
|
define double @bar() {
|
2010-09-18 04:15:53 +08:00
|
|
|
%t = call double @sin(double 0.0)
|
2010-09-17 09:38:06 +08:00
|
|
|
ret double %t
|
|
|
|
}
|
|
|
|
|
|
|
|
declare double @sin(double)
|