blob: 809077bd452ad0e6b92994db83cbb7dfe6bdef2c [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001; fsqrt should be generated when the fsqrt feature is enabled, but not
2; otherwise.
3
4; RUN: llvm-upgrade < %s | llvm-as | \
5; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -mattr=+fsqrt | \
6; RUN: grep {fsqrt f1, f1}
7; RUN: llvm-upgrade < %s | llvm-as | \
8; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -mcpu=g5 | \
9; RUN: grep {fsqrt f1, f1}
10; RUN: llvm-upgrade < %s | llvm-as | \
11; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -mattr=-fsqrt | \
12; RUN: not grep {fsqrt f1, f1}
13; RUN: llvm-upgrade < %s | llvm-as | \
14; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -mcpu=g4 | \
15; RUN: not grep {fsqrt f1, f1}
16
17declare double %llvm.sqrt.f64(double)
18double %X(double %Y) {
19 %Z = call double %llvm.sqrt.f64(double %Y)
20 ret double %Z
21}