blob: 1260c602f9d9c679ab7cef0dc44835b1ae627d37 [file] [log] [blame]
Chris Lattner446a4ea2005-09-02 18:32:22 +00001; fsqrt should be generated when the fsqrt feature is enabled, but not
2; otherwise.
3
Tanya Lattnercfab3da2008-02-19 08:07:33 +00004; RUN: llvm-as < %s | \
Reid Spencerc58ef012007-04-15 21:17:45 +00005; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -mattr=+fsqrt | \
6; RUN: grep {fsqrt f1, f1}
Tanya Lattnercfab3da2008-02-19 08:07:33 +00007; RUN: llvm-as < %s | \
Reid Spencerc58ef012007-04-15 21:17:45 +00008; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -mcpu=g5 | \
9; RUN: grep {fsqrt f1, f1}
Tanya Lattnercfab3da2008-02-19 08:07:33 +000010; RUN: llvm-as < %s | \
Reid Spencerc58ef012007-04-15 21:17:45 +000011; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -mattr=-fsqrt | \
12; RUN: not grep {fsqrt f1, f1}
Tanya Lattnercfab3da2008-02-19 08:07:33 +000013; RUN: llvm-as < %s | \
Reid Spencerc58ef012007-04-15 21:17:45 +000014; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -mcpu=g4 | \
15; RUN: not grep {fsqrt f1, f1}
Chris Lattner446a4ea2005-09-02 18:32:22 +000016
Tanya Lattnercfab3da2008-02-19 08:07:33 +000017declare double @llvm.sqrt.f64(double)
18
19define double @X(double %Y) {
20 %Z = call double @llvm.sqrt.f64( double %Y ) ; <double> [#uses=1]
21 ret double %Z
Chris Lattner446a4ea2005-09-02 18:32:22 +000022}
Tanya Lattnercfab3da2008-02-19 08:07:33 +000023