aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.target/sparc/sparc-trap-1.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.target/sparc/sparc-trap-1.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/sparc/sparc-trap-1.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.target/sparc/sparc-trap-1.c b/gcc-4.9/gcc/testsuite/gcc.target/sparc/sparc-trap-1.c
new file mode 100644
index 000000000..82a86fbe1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.target/sparc/sparc-trap-1.c
@@ -0,0 +1,21 @@
+/* PR target/15693 */
+
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+/* This used to fail on SPARC at -O2 because the combiner
+ produces a compare insn that was not rematched by the
+ compare expander. */
+
+static __inline__ __attribute__ ((always_inline))
+int page_mapping (unsigned flags)
+{
+ if (1u & (flags >> 16))
+ return 1;
+ return 0;
+}
+void install_page (unsigned flags)
+{
+ if (__builtin_expect (!page_mapping (flags), 0))
+ __builtin_trap ();
+}