aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/20030220-1.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.c-torture/compile/20030220-1.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.c-torture/compile/20030220-1.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/20030220-1.c b/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/20030220-1.c
new file mode 100644
index 000000000..59a03e42c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/20030220-1.c
@@ -0,0 +1,20 @@
+/* PR optimization/9768 */
+/* Originator: Randolph Chung <tausq@debian.org> */
+
+inline int fixfloor (long x)
+{
+ if (x >= 0)
+ return (x >> 16);
+ else
+ return ~((~x) >> 16);
+}
+
+inline int fixtoi (long x)
+{
+ return fixfloor(x) + ((x & 0x8000) >> 15);
+}
+
+int foo(long x, long y)
+{
+ return fixtoi(x*y);
+}