summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/sparc/sparc-dwarf2.c
diff options
context:
space:
mode:
authorupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
committerupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
commit554fd8c5195424bdbcabf5de30fdc183aba391bd (patch)
tree976dc5ab7fddf506dadce60ae936f43f58787092 /gcc/testsuite/gcc.target/sparc/sparc-dwarf2.c
downloadcbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.bz2
cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.xz
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository.
Diffstat (limited to 'gcc/testsuite/gcc.target/sparc/sparc-dwarf2.c')
-rw-r--r--gcc/testsuite/gcc.target/sparc/sparc-dwarf2.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/sparc/sparc-dwarf2.c b/gcc/testsuite/gcc.target/sparc/sparc-dwarf2.c
new file mode 100644
index 000000000..819ec3863
--- /dev/null
+++ b/gcc/testsuite/gcc.target/sparc/sparc-dwarf2.c
@@ -0,0 +1,32 @@
+/* PR target/10114 */
+/* Originator: James Troup <james@nocrew.org> */
+
+/* { dg-do compile } */
+/* { dg-options "-g -O1" } */
+
+extern __inline double sqrt (double __x)
+{
+ register double __r;
+ __asm ("fsqrtd %1,%0" : "=f" (__r) : "f" (__x));
+ return __r;
+}
+
+static double our_skew, max_update_skew;
+
+static double Sqr(double x)
+{
+ return x*x;
+}
+
+void REF_SetReference(double skew)
+{
+ double previous_skew, new_skew;
+ double old_weight, new_weight, sum_weight;
+ double delta_freq1, delta_freq2;
+ double skew1, skew2;
+
+ previous_skew = our_skew;
+ skew1 = sqrt((Sqr(delta_freq1) * old_weight + Sqr(delta_freq2) * new_weight) / sum_weight);
+ skew2 = (previous_skew * old_weight + new_skew * new_weight) / sum_weight;
+ our_skew = skew1 + skew2;
+}