summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/xstormy16/below_100.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.target/xstormy16/below_100.c')
-rw-r--r--gcc/testsuite/gcc.target/xstormy16/below_100.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/xstormy16/below_100.c b/gcc/testsuite/gcc.target/xstormy16/below_100.c
new file mode 100644
index 000000000..9433f2ad8
--- /dev/null
+++ b/gcc/testsuite/gcc.target/xstormy16/below_100.c
@@ -0,0 +1,30 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-final { scan-assembler "bn " } } */
+/* { dg-final { scan-assembler "b\[np\] " } } */
+
+unsigned short a_below __attribute__((__BELOW100__));
+unsigned short b_below __attribute__((__BELOW100__));
+unsigned short * a_ptr = & a_below;
+unsigned short * b_ptr = & b_below;
+
+char *
+foo (void)
+{
+ if (a_below & 0x0100)
+ {
+ if (b_below & 0x0100)
+ return "Fail";
+ return "Success";
+ }
+
+ return "Fail";
+}
+
+char *
+bar (void)
+{
+ *a_ptr = 0x0100;
+ *b_ptr = 0xfeff;
+ return foo ();
+}