diff options
Diffstat (limited to 'gcc/testsuite/gcc.target/xstormy16/bss_below100')
66 files changed, 2244 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/01_const_to_b100b.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/01_const_to_b100b.c new file mode 100644 index 000000000..2b4438c4c --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/01_const_to_b100b.c @@ -0,0 +1,20 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "mov.b B100,#18" } } */ + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +unsigned char B100 __attribute__ ((__BELOW100__)); +unsigned char *p = &B100; + +void +Do (void) +{ + B100 = 0x12; +} + +int +main (void) +{ + *p = 0x34; + Do (); + return (*p == 0x12) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/02_const_to_b100w.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/02_const_to_b100w.c new file mode 100644 index 000000000..d011ffd66 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/02_const_to_b100w.c @@ -0,0 +1,20 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "mov.w B100,#4660" } } */ + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +unsigned short B100 __attribute__ ((__BELOW100__)); +unsigned short *p = &B100; + +void +Do (void) +{ + B100 = 0x1234; +} + +int +main (void) +{ + *p = 0x9876; + Do (); + return (*p == 0x1234) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/03_var_to_b100b.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/03_var_to_b100b.c new file mode 100644 index 000000000..bcc991189 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/03_var_to_b100b.c @@ -0,0 +1,22 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "mov.b B100,r" } } */ + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +unsigned char B100 __attribute__ ((__BELOW100__)); +unsigned char *p = &B100; + +unsigned char yData = 0x12; + +void +Do (void) +{ + B100 = yData; +} + +int +main (void) +{ + *p = 0x34; + Do (); + return (*p == 0x12) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/04_var_to_b100w.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/04_var_to_b100w.c new file mode 100644 index 000000000..ab4748871 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/04_var_to_b100w.c @@ -0,0 +1,22 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "mov.w B100,r" } } */ + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +unsigned short B100 __attribute__ ((__BELOW100__)); +unsigned short *p = &B100; + +unsigned short wData = 0x1234; + +void +Do (void) +{ + B100 = wData; +} + +int +main (void) +{ + *p = 0x9876; + Do (); + return (*p == 0x1234) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/05_b100b_to_var.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/05_b100b_to_var.c new file mode 100644 index 000000000..e5f57e803 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/05_b100b_to_var.c @@ -0,0 +1,22 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "mov.b r., *B100" } } */ + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +unsigned char B100 __attribute__ ((__BELOW100__)); +unsigned char *p = &B100; + +unsigned char yData = 0x12; + +void +Do (void) +{ + yData = B100; +} + +int +main (void) +{ + *p = 0x34; + Do (); + return (yData == 0x34) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/06_b100w_to_var.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/06_b100w_to_var.c new file mode 100644 index 000000000..b19d9bcf4 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/06_b100w_to_var.c @@ -0,0 +1,22 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "mov.w r.,B100" } } */ + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +unsigned short B100 __attribute__ ((__BELOW100__)); +unsigned short *p = &B100; + +unsigned short wData = 0x1234; + +void +Do (void) +{ + wData = B100; +} + +int +main (void) +{ + *p = 0x3456; + Do (); + return (wData == 0x3456) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/10_set_b100b_bit_0.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/10_set_b100b_bit_0.c new file mode 100644 index 000000000..f0965f110 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/10_set_b100b_bit_0.c @@ -0,0 +1,20 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "set1 B100,#0" } } */ + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +unsigned char B100 __attribute__ ((__BELOW100__)); +unsigned char *p = &B100; + +void +Do (void) +{ + B100 |= 0x01; +} + +int +main (void) +{ + *p = 0x34; + Do (); + return (*p == 0x35) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/10_set_b100b_bit_7.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/10_set_b100b_bit_7.c new file mode 100644 index 000000000..8b14c4308 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/10_set_b100b_bit_7.c @@ -0,0 +1,20 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "set1 B100,#7" } } */ + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +unsigned char B100 __attribute__ ((__BELOW100__)); +unsigned char *p = &B100; + +void +Do (void) +{ + B100 |= 0x80; +} + +int +main (void) +{ + *p = 0x34; + Do (); + return (*p == 0xb4) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/11_clr_b100b_bit_0.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/11_clr_b100b_bit_0.c new file mode 100644 index 000000000..79c265a24 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/11_clr_b100b_bit_0.c @@ -0,0 +1,20 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "clr1 B100,#0" } } */ + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +unsigned char B100 __attribute__ ((__BELOW100__)); +unsigned char *p = &B100; + +void +Do (void) +{ + B100 &= ~0x01; +} + +int +main (void) +{ + *p = 0xcb; + Do (); + return (*p == 0xca) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/11_clr_b100b_bit_7.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/11_clr_b100b_bit_7.c new file mode 100644 index 000000000..d40e68f55 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/11_clr_b100b_bit_7.c @@ -0,0 +1,20 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "clr1 B100,#7" } } */ + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +unsigned char B100 __attribute__ ((__BELOW100__)); +unsigned char *p = &B100; + +void +Do (void) +{ + B100 &= ~0x80; +} + +int +main (void) +{ + *p = 0xcb; + Do (); + return (*p == 0x4b) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/12_if1_b100b_bit_0.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/12_if1_b100b_bit_0.c new file mode 100644 index 000000000..26b3711ea --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/12_if1_b100b_bit_0.c @@ -0,0 +1,31 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "b\[np\] B100A,#0," } } */ +/* { dg-final { scan-assembler "b\[np\] B100B,#0," } } */ + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +unsigned char B100A __attribute__ ((__BELOW100__)); +unsigned char *pA = &B100A; +unsigned char B100B __attribute__ ((__BELOW100__)); +unsigned char *pB = &B100B; + +char * +Do (void) +{ + if (B100A & 0x01) + { + if (B100B & 0x01) + return "Fail"; + else + return "Success"; + } + else + return "Fail"; +} + +int +main (void) +{ + *pA = 0xcb; + *pB = 0x34; + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/12_if1_b100b_bit_3.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/12_if1_b100b_bit_3.c new file mode 100644 index 000000000..865ec549b --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/12_if1_b100b_bit_3.c @@ -0,0 +1,31 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "b\[np\] B100A,#3," } } */ +/* { dg-final { scan-assembler "b\[np\] B100B,#3," } } */ + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +unsigned char B100A __attribute__ ((__BELOW100__)); +unsigned char *pA = &B100A; +unsigned char B100B __attribute__ ((__BELOW100__)); +unsigned char *pB = &B100B; + +char * +Do (void) +{ + if (B100A & 0x08) + { + if (B100B & 0x08) + return "Fail"; + else + return "Success"; + } + else + return "Fail"; +} + +int +main (void) +{ + *pA = 0xcb; + *pB = 0x34; + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/12_if1_b100b_bit_7.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/12_if1_b100b_bit_7.c new file mode 100644 index 000000000..efbe1243c --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/12_if1_b100b_bit_7.c @@ -0,0 +1,31 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "b\[np\] B100A,#7," } } */ +/* { dg-final { scan-assembler "b\[np\] B100B,#7," } } */ + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +unsigned char B100A __attribute__ ((__BELOW100__)); +unsigned char *pA = &B100A; +unsigned char B100B __attribute__ ((__BELOW100__)); +unsigned char *pB = &B100B; + +char * +Do (void) +{ + if (B100A & 0x80) + { + if (B100B & 0x80) + return "Fail"; + else + return "Success"; + } + else + return "Fail"; +} + +int +main (void) +{ + *pA = 0xcb; + *pB = 0x34; + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/13_if0_b100b_bit_0.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/13_if0_b100b_bit_0.c new file mode 100644 index 000000000..81873954c --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/13_if0_b100b_bit_0.c @@ -0,0 +1,31 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "b\[np\] B100A,#0," } } */ +/* { dg-final { scan-assembler "b\[np\] B100B,#0," } } */ + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +unsigned char B100A __attribute__ ((__BELOW100__)); +unsigned char *pA = &B100A; +unsigned char B100B __attribute__ ((__BELOW100__)); +unsigned char *pB = &B100B; + +char * +Do (void) +{ + if (!(B100A & 0x01)) + { + if (!(B100B & 0x01)) + return "Fail"; + else + return "Success"; + } + else + return "Fail"; +} + +int +main (void) +{ + *pA = 0x34; + *pB = 0xcb; + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/13_if0_b100b_bit_3.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/13_if0_b100b_bit_3.c new file mode 100644 index 000000000..3fc566aa9 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/13_if0_b100b_bit_3.c @@ -0,0 +1,31 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "b\[np\] B100A,#3," } } */ +/* { dg-final { scan-assembler "b\[np\] B100B,#3," } } */ + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +unsigned char B100A __attribute__ ((__BELOW100__)); +unsigned char *pA = &B100A; +unsigned char B100B __attribute__ ((__BELOW100__)); +unsigned char *pB = &B100B; + +char * +Do (void) +{ + if (!(B100A & 0x08)) + { + if (!(B100B & 0x08)) + return "Fail"; + else + return "Success"; + } + else + return "Fail"; +} + +int +main (void) +{ + *pA = 0x34; + *pB = 0xcb; + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/13_if0_b100b_bit_7.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/13_if0_b100b_bit_7.c new file mode 100644 index 000000000..bc90eaf95 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/13_if0_b100b_bit_7.c @@ -0,0 +1,31 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "b\[np\] B100A,#7," } } */ +/* { dg-final { scan-assembler "b\[np\] B100B,#7," } } */ + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +unsigned char B100A __attribute__ ((__BELOW100__)); +unsigned char *pA = &B100A; +unsigned char B100B __attribute__ ((__BELOW100__)); +unsigned char *pB = &B100B; + +char * +Do (void) +{ + if (!(B100A & 0x80)) + { + if (!(B100B & 0x80)) + return "Fail"; + else + return "Success"; + } + else + return "Fail"; +} + +int +main (void) +{ + *pA = 0x34; + *pB = 0xcb; + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/14_set_b100w_bit_0.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/14_set_b100w_bit_0.c new file mode 100644 index 000000000..9164d05df --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/14_set_b100w_bit_0.c @@ -0,0 +1,20 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "set1 B100,#0" } } */ + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +unsigned short B100 __attribute__ ((__BELOW100__)); +unsigned short *p = &B100; + +void +Do (void) +{ + B100 |= 0x0001; +} + +int +main (void) +{ + *p = 0x1234; + Do (); + return (*p == 0x1235) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/14_set_b100w_bit_7.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/14_set_b100w_bit_7.c new file mode 100644 index 000000000..848c3241f --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/14_set_b100w_bit_7.c @@ -0,0 +1,20 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "set1 B100,#7" } } */ + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +unsigned short B100 __attribute__ ((__BELOW100__)); +unsigned short *p = &B100; + +void +Do (void) +{ + B100 |= 0x0080; +} + +int +main (void) +{ + *p = 0x1234; + Do (); + return (*p == 0x12b4) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/14_set_b100w_bit_8.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/14_set_b100w_bit_8.c new file mode 100644 index 000000000..f843d12af --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/14_set_b100w_bit_8.c @@ -0,0 +1,20 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "set1 B100\\+1,#0" } } */ + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +unsigned short B100 __attribute__ ((__BELOW100__)); +unsigned short *p = &B100; + +void +Do (void) +{ + B100 |= 0x0100; +} + +int +main (void) +{ + *p = 0x1234; + Do (); + return (*p == 0x1334) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/14_set_b100w_bit_f.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/14_set_b100w_bit_f.c new file mode 100644 index 000000000..bba6dc9f4 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/14_set_b100w_bit_f.c @@ -0,0 +1,20 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "set1 B100\\+1,#7" } } */ + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +unsigned short B100 __attribute__ ((__BELOW100__)); +unsigned short *p = &B100; + +void +Do (void) +{ + B100 |= 0x8000; +} + +int +main (void) +{ + *p = 0x1234; + Do (); + return (*p == 0x9234) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/15_clr_b100w_bit_0.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/15_clr_b100w_bit_0.c new file mode 100644 index 000000000..634f2fc65 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/15_clr_b100w_bit_0.c @@ -0,0 +1,20 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "clr1 B100,#0" } } */ + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +unsigned short B100 __attribute__ ((__BELOW100__)); +unsigned short *p = &B100; + +void +Do (void) +{ + B100 &= ~0x0001; +} + +int +main (void) +{ + *p = 0xedcb; + Do (); + return (*p == 0xedca) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/15_clr_b100w_bit_7.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/15_clr_b100w_bit_7.c new file mode 100644 index 000000000..4b7d1bd72 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/15_clr_b100w_bit_7.c @@ -0,0 +1,20 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "clr1 B100,#7" } } */ + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +unsigned short B100 __attribute__ ((__BELOW100__)); +unsigned short *p = &B100; + +void +Do (void) +{ + B100 &= ~0x0080; +} + +int +main (void) +{ + *p = 0xedcb; + Do (); + return (*p == 0xed4b) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/15_clr_b100w_bit_8.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/15_clr_b100w_bit_8.c new file mode 100644 index 000000000..1c5d4c402 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/15_clr_b100w_bit_8.c @@ -0,0 +1,20 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "clr1 B100\\+1,#0" } } */ + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +unsigned short B100 __attribute__ ((__BELOW100__)); +unsigned short *p = &B100; + +void +Do (void) +{ + B100 &= ~0x0100; +} + +int +main (void) +{ + *p = 0xedcb; + Do (); + return (*p == 0xeccb) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/15_clr_b100w_bit_f.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/15_clr_b100w_bit_f.c new file mode 100644 index 000000000..5140c6caf --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/15_clr_b100w_bit_f.c @@ -0,0 +1,20 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "clr1 B100\\+1,#7" } } */ + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +unsigned short B100 __attribute__ ((__BELOW100__)); +unsigned short *p = &B100; + +void +Do (void) +{ + B100 &= ~0x8000; +} + +int +main (void) +{ + *p = 0xedcb; + Do (); + return (*p == 0x6dcb) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/16_if1_b100w_bit_0.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/16_if1_b100w_bit_0.c new file mode 100644 index 000000000..fb6a1ba31 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/16_if1_b100w_bit_0.c @@ -0,0 +1,31 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "b\[np\] B100A,#0," } } */ +/* { dg-final { scan-assembler "b\[np\] B100B,#0," } } */ + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +unsigned short B100A __attribute__ ((__BELOW100__)); +unsigned short *pA = &B100A; +unsigned short B100B __attribute__ ((__BELOW100__)); +unsigned short *pB = &B100B; + +char * +Do (void) +{ + if (B100A & 0x0001) + { + if (B100B & 0x0001) + return "Fail"; + else + return "Success"; + } + else + return "Fail"; +} + +int +main (void) +{ + *pA = 0xedcb; + *pB = 0x1234; + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/16_if1_b100w_bit_3.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/16_if1_b100w_bit_3.c new file mode 100644 index 000000000..c62462914 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/16_if1_b100w_bit_3.c @@ -0,0 +1,31 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "b\[np\] B100A,#3," } } */ +/* { dg-final { scan-assembler "b\[np\] B100B,#3," } } */ + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +unsigned short B100A __attribute__ ((__BELOW100__)); +unsigned short *pA = &B100A; +unsigned short B100B __attribute__ ((__BELOW100__)); +unsigned short *pB = &B100B; + +char * +Do (void) +{ + if (B100A & 0x0008) + { + if (B100B & 0x0008) + return "Fail"; + else + return "Success"; + } + else + return "Fail"; +} + +int +main (void) +{ + *pA = 0xedcb; + *pB = 0x1234; + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/16_if1_b100w_bit_7.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/16_if1_b100w_bit_7.c new file mode 100644 index 000000000..d1c3fbf56 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/16_if1_b100w_bit_7.c @@ -0,0 +1,31 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "b\[np\] B100A,#7," } } */ +/* { dg-final { scan-assembler "b\[np\] B100B,#7," } } */ + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +unsigned short B100A __attribute__ ((__BELOW100__)); +unsigned short *pA = &B100A; +unsigned short B100B __attribute__ ((__BELOW100__)); +unsigned short *pB = &B100B; + +char * +Do (void) +{ + if (B100A & 0x0080) + { + if (B100B & 0x0080) + return "Fail"; + else + return "Success"; + } + else + return "Fail"; +} + +int +main (void) +{ + *pA = 0xedcb; + *pB = 0x1234; + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/16_if1_b100w_bit_8.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/16_if1_b100w_bit_8.c new file mode 100644 index 000000000..b10454203 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/16_if1_b100w_bit_8.c @@ -0,0 +1,31 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "b\[np\] B100A\\+1,#0," } } */ +/* { dg-final { scan-assembler "b\[np\] B100B\\+1,#0," } } */ + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +unsigned short B100A __attribute__ ((__BELOW100__)); +unsigned short *pA = &B100A; +unsigned short B100B __attribute__ ((__BELOW100__)); +unsigned short *pB = &B100B; + +char * +Do (void) +{ + if (B100A & 0x0100) + { + if (B100B & 0x0100) + return "Fail"; + else + return "Success"; + } + else + return "Fail"; +} + +int +main (void) +{ + *pA = 0xedcb; + *pB = 0x1234; + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/16_if1_b100w_bit_b.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/16_if1_b100w_bit_b.c new file mode 100644 index 000000000..8fbded125 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/16_if1_b100w_bit_b.c @@ -0,0 +1,31 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "b\[np\] B100A\\+1,#3," } } */ +/* { dg-final { scan-assembler "b\[np\] B100B\\+1,#3," } } */ + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +unsigned short B100A __attribute__ ((__BELOW100__)); +unsigned short *pA = &B100A; +unsigned short B100B __attribute__ ((__BELOW100__)); +unsigned short *pB = &B100B; + +char * +Do (void) +{ + if (B100A & 0x0800) + { + if (B100B & 0x0800) + return "Fail"; + else + return "Success"; + } + else + return "Fail"; +} + +int +main (void) +{ + *pA = 0xedcb; + *pB = 0x1234; + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/16_if1_b100w_bit_f.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/16_if1_b100w_bit_f.c new file mode 100644 index 000000000..ae97d96a8 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/16_if1_b100w_bit_f.c @@ -0,0 +1,31 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "b\[np\] B100A\\+1,#7," } } */ +/* { dg-final { scan-assembler "b\[np\] B100B\\+1,#7," } } */ + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +unsigned short B100A __attribute__ ((__BELOW100__)); +unsigned short *pA = &B100A; +unsigned short B100B __attribute__ ((__BELOW100__)); +unsigned short *pB = &B100B; + +char * +Do (void) +{ + if (B100A & 0x8000) + { + if (B100B & 0x8000) + return "Fail"; + else + return "Success"; + } + else + return "Fail"; +} + +int +main (void) +{ + *pA = 0xedcb; + *pB = 0x1234; + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/17_if0_b100w_bit_0.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/17_if0_b100w_bit_0.c new file mode 100644 index 000000000..07c6e94d5 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/17_if0_b100w_bit_0.c @@ -0,0 +1,31 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "b\[np\] B100A,#0," } } */ +/* { dg-final { scan-assembler "b\[np\] B100B,#0," } } */ + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +unsigned short B100A __attribute__ ((__BELOW100__)); +unsigned short *pA = &B100A; +unsigned short B100B __attribute__ ((__BELOW100__)); +unsigned short *pB = &B100B; + +char * +Do (void) +{ + if (!(B100A & 0x0001)) + { + if (!(B100B & 0x0001)) + return "Fail"; + else + return "Success"; + } + else + return "Fail"; +} + +int +main (void) +{ + *pA = 0x1234; + *pB = 0xedcb; + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/17_if0_b100w_bit_3.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/17_if0_b100w_bit_3.c new file mode 100644 index 000000000..f2dd3fba6 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/17_if0_b100w_bit_3.c @@ -0,0 +1,31 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "b\[np\] B100A,#3," } } */ +/* { dg-final { scan-assembler "b\[np\] B100B,#3," } } */ + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +unsigned short B100A __attribute__ ((__BELOW100__)); +unsigned short *pA = &B100A; +unsigned short B100B __attribute__ ((__BELOW100__)); +unsigned short *pB = &B100B; + +char * +Do (void) +{ + if (!(B100A & 0x0008)) + { + if (!(B100B & 0x0008)) + return "Fail"; + else + return "Success"; + } + else + return "Fail"; +} + +int +main (void) +{ + *pA = 0x1234; + *pB = 0xedcb; + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/17_if0_b100w_bit_7.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/17_if0_b100w_bit_7.c new file mode 100644 index 000000000..af6eb6e17 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/17_if0_b100w_bit_7.c @@ -0,0 +1,31 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "b\[np\] B100A,#7," } } */ +/* { dg-final { scan-assembler "b\[np\] B100B,#7," } } */ + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +unsigned short B100A __attribute__ ((__BELOW100__)); +unsigned short *pA = &B100A; +unsigned short B100B __attribute__ ((__BELOW100__)); +unsigned short *pB = &B100B; + +char * +Do (void) +{ + if (!(B100A & 0x0080)) + { + if (!(B100B & 0x0080)) + return "Fail"; + else + return "Success"; + } + else + return "Fail"; +} + +int +main (void) +{ + *pA = 0x1234; + *pB = 0xedcb; + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/17_if0_b100w_bit_8.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/17_if0_b100w_bit_8.c new file mode 100644 index 000000000..d50f8f82b --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/17_if0_b100w_bit_8.c @@ -0,0 +1,31 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "b\[np\] B100A\\+1,#0," } } */ +/* { dg-final { scan-assembler "b\[np\] B100B\\+1,#0," } } */ + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +unsigned short B100A __attribute__ ((__BELOW100__)); +unsigned short *pA = &B100A; +unsigned short B100B __attribute__ ((__BELOW100__)); +unsigned short *pB = &B100B; + +char * +Do (void) +{ + if (!(B100A & 0x0100)) + { + if (!(B100B & 0x0100)) + return "Fail"; + else + return "Success"; + } + else + return "Fail"; +} + +int +main (void) +{ + *pA = 0x1234; + *pB = 0xedcb; + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/17_if0_b100w_bit_b.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/17_if0_b100w_bit_b.c new file mode 100644 index 000000000..28d5a39bb --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/17_if0_b100w_bit_b.c @@ -0,0 +1,31 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "b\[np\] B100A\\+1,#3," } } */ +/* { dg-final { scan-assembler "b\[np\] B100B\\+1,#3," } } */ + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +unsigned short B100A __attribute__ ((__BELOW100__)); +unsigned short *pA = &B100A; +unsigned short B100B __attribute__ ((__BELOW100__)); +unsigned short *pB = &B100B; + +char * +Do (void) +{ + if (!(B100A & 0x0800)) + { + if (!(B100B & 0x0800)) + return "Fail"; + else + return "Success"; + } + else + return "Fail"; +} + +int +main (void) +{ + *pA = 0x1234; + *pB = 0xedcb; + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/17_if0_b100w_bit_f.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/17_if0_b100w_bit_f.c new file mode 100644 index 000000000..6a3f7025f --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/17_if0_b100w_bit_f.c @@ -0,0 +1,31 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "b\[np\] B100A\\+1,#7," } } */ +/* { dg-final { scan-assembler "b\[np\] B100B\\+1,#7," } } */ + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +unsigned short B100A __attribute__ ((__BELOW100__)); +unsigned short *pA = &B100A; +unsigned short B100B __attribute__ ((__BELOW100__)); +unsigned short *pB = &B100B; + +char * +Do (void) +{ + if (!(B100A & 0x8000)) + { + if (!(B100B & 0x8000)) + return "Fail"; + else + return "Success"; + } + else + return "Fail"; +} + +int +main (void) +{ + *pA = 0x1234; + *pB = 0xedcb; + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/20_set_b100b_bitfield_0.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/20_set_b100b_bitfield_0.c new file mode 100644 index 000000000..240e47299 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/20_set_b100b_bitfield_0.c @@ -0,0 +1,32 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "set1 B100,#0" } } */ + +typedef struct +{ + unsigned char b0:1; + unsigned char b1:1; + unsigned char b2:1; + unsigned char b3:1; + unsigned char b4:1; + unsigned char b5:1; + unsigned char b6:1; + unsigned char b7:1; +} BitField; + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +BitField B100 __attribute__ ((__BELOW100__)); +unsigned char *p = (unsigned char *) &B100; + +void +Do (void) +{ + B100.b0 = 1; +} + +int +main (void) +{ + *p = 0x34; + Do (); + return (*p == 0x35) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/20_set_b100b_bitfield_7.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/20_set_b100b_bitfield_7.c new file mode 100644 index 000000000..674e51a64 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/20_set_b100b_bitfield_7.c @@ -0,0 +1,32 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "set1 B100,#7" } } */ + +typedef struct +{ + unsigned char b0:1; + unsigned char b1:1; + unsigned char b2:1; + unsigned char b3:1; + unsigned char b4:1; + unsigned char b5:1; + unsigned char b6:1; + unsigned char b7:1; +} BitField; + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +BitField B100 __attribute__ ((__BELOW100__)); +unsigned char *p = (unsigned char *) &B100; + +void +Do (void) +{ + B100.b7 = 1; +} + +int +main (void) +{ + *p = 0x34; + Do (); + return (*p == 0xb4) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/21_clr_b100b_bitfield_0.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/21_clr_b100b_bitfield_0.c new file mode 100644 index 000000000..3846a96d2 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/21_clr_b100b_bitfield_0.c @@ -0,0 +1,32 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "clr1 B100,#0" } } */ + +typedef struct +{ + unsigned char b0:1; + unsigned char b1:1; + unsigned char b2:1; + unsigned char b3:1; + unsigned char b4:1; + unsigned char b5:1; + unsigned char b6:1; + unsigned char b7:1; +} BitField; + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +BitField B100 __attribute__ ((__BELOW100__)); +unsigned char *p = (unsigned char *) &B100; + +void +Do (void) +{ + B100.b0 = 0; +} + +int +main (void) +{ + *p = 0xcb; + Do (); + return (*p == 0xca) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/21_clr_b100b_bitfield_7.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/21_clr_b100b_bitfield_7.c new file mode 100644 index 000000000..10174576f --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/21_clr_b100b_bitfield_7.c @@ -0,0 +1,32 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "clr1 B100,#7" } } */ + +typedef struct +{ + unsigned char b0:1; + unsigned char b1:1; + unsigned char b2:1; + unsigned char b3:1; + unsigned char b4:1; + unsigned char b5:1; + unsigned char b6:1; + unsigned char b7:1; +} BitField; + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +BitField B100 __attribute__ ((__BELOW100__)); +unsigned char *p = (unsigned char *) &B100; + +void +Do (void) +{ + B100.b7 = 0; +} + +int +main (void) +{ + *p = 0xcb; + Do (); + return (*p == 0x4b) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/22_if1_b100b_bitfield_0.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/22_if1_b100b_bitfield_0.c new file mode 100644 index 000000000..9c4135776 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/22_if1_b100b_bitfield_0.c @@ -0,0 +1,43 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "b\[np\] B100A,#0," } } */ +/* { dg-final { scan-assembler "b\[np\] B100B,#0," } } */ + +typedef struct +{ + unsigned char b0:1; + unsigned char b1:1; + unsigned char b2:1; + unsigned char b3:1; + unsigned char b4:1; + unsigned char b5:1; + unsigned char b6:1; + unsigned char b7:1; +} BitField; + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +BitField B100A __attribute__ ((__BELOW100__)); +unsigned char *pA = (unsigned char *) &B100A; +BitField B100B __attribute__ ((__BELOW100__)); +unsigned char *pB = (unsigned char *) &B100B; + +char * +Do (void) +{ + if (B100A.b0) + { + if (B100B.b0) + return "Fail"; + else + return "Success"; + } + else + return "Fail"; +} + +int +main (void) +{ + *pA = 0xcb; + *pB = 0x34; + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/22_if1_b100b_bitfield_3.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/22_if1_b100b_bitfield_3.c new file mode 100644 index 000000000..86f0f22f1 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/22_if1_b100b_bitfield_3.c @@ -0,0 +1,43 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "b\[np\] B100A,#3," } } */ +/* { dg-final { scan-assembler "b\[np\] B100B,#3," } } */ + +typedef struct +{ + unsigned char b0:1; + unsigned char b1:1; + unsigned char b2:1; + unsigned char b3:1; + unsigned char b4:1; + unsigned char b5:1; + unsigned char b6:1; + unsigned char b7:1; +} BitField; + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +BitField B100A __attribute__ ((__BELOW100__)); +unsigned char *pA = (unsigned char *) &B100A; +BitField B100B __attribute__ ((__BELOW100__)); +unsigned char *pB = (unsigned char *) &B100B; + +char * +Do (void) +{ + if (B100A.b3) + { + if (B100B.b3) + return "Fail"; + else + return "Success"; + } + else + return "Fail"; +} + +int +main (void) +{ + *pA = 0xcb; + *pB = 0x34; + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/22_if1_b100b_bitfield_7.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/22_if1_b100b_bitfield_7.c new file mode 100644 index 000000000..0df2f55dd --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/22_if1_b100b_bitfield_7.c @@ -0,0 +1,43 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "b\[np\] B100A,#7," } } */ +/* { dg-final { scan-assembler "b\[np\] B100B,#7," } } */ + +typedef struct +{ + unsigned char b0:1; + unsigned char b1:1; + unsigned char b2:1; + unsigned char b3:1; + unsigned char b4:1; + unsigned char b5:1; + unsigned char b6:1; + unsigned char b7:1; +} BitField; + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +BitField B100A __attribute__ ((__BELOW100__)); +unsigned char *pA = (unsigned char *) &B100A; +BitField B100B __attribute__ ((__BELOW100__)); +unsigned char *pB = (unsigned char *) &B100B; + +char * +Do (void) +{ + if (B100A.b7) + { + if (B100B.b7) + return "Fail"; + else + return "Success"; + } + else + return "Fail"; +} + +int +main (void) +{ + *pA = 0xcb; + *pB = 0x34; + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/23_if0_b100b_bitfield_0.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/23_if0_b100b_bitfield_0.c new file mode 100644 index 000000000..9acd8a6f9 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/23_if0_b100b_bitfield_0.c @@ -0,0 +1,43 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "b\[np\] B100A,#0," } } */ +/* { dg-final { scan-assembler "b\[np\] B100B,#0," } } */ + +typedef struct +{ + unsigned char b0:1; + unsigned char b1:1; + unsigned char b2:1; + unsigned char b3:1; + unsigned char b4:1; + unsigned char b5:1; + unsigned char b6:1; + unsigned char b7:1; +} BitField; + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +BitField B100A __attribute__ ((__BELOW100__)); +unsigned char *pA = (unsigned char *) &B100A; +BitField B100B __attribute__ ((__BELOW100__)); +unsigned char *pB = (unsigned char *) &B100B; + +char * +Do (void) +{ + if (!B100A.b0) + { + if (!B100B.b0) + return "Fail"; + else + return "Success"; + } + else + return "Fail"; +} + +int +main (void) +{ + *pA = 0x34; + *pB = 0xcb; + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/23_if0_b100b_bitfield_3.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/23_if0_b100b_bitfield_3.c new file mode 100644 index 000000000..3ddbc1a10 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/23_if0_b100b_bitfield_3.c @@ -0,0 +1,43 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "b\[np\] B100A,#3," } } */ +/* { dg-final { scan-assembler "b\[np\] B100B,#3," } } */ + +typedef struct +{ + unsigned char b0:1; + unsigned char b1:1; + unsigned char b2:1; + unsigned char b3:1; + unsigned char b4:1; + unsigned char b5:1; + unsigned char b6:1; + unsigned char b7:1; +} BitField; + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +BitField B100A __attribute__ ((__BELOW100__)); +unsigned char *pA = (unsigned char *) &B100A; +BitField B100B __attribute__ ((__BELOW100__)); +unsigned char *pB = (unsigned char *) &B100B; + +char * +Do (void) +{ + if (!B100A.b3) + { + if (!B100B.b3) + return "Fail"; + else + return "Success"; + } + else + return "Fail"; +} + +int +main (void) +{ + *pA = 0x34; + *pB = 0xcb; + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/23_if0_b100b_bitfield_7.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/23_if0_b100b_bitfield_7.c new file mode 100644 index 000000000..3c0802e1e --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/23_if0_b100b_bitfield_7.c @@ -0,0 +1,43 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "b\[np\] B100A,#7," } } */ +/* { dg-final { scan-assembler "b\[np\] B100B,#7," } } */ + +typedef struct +{ + unsigned char b0:1; + unsigned char b1:1; + unsigned char b2:1; + unsigned char b3:1; + unsigned char b4:1; + unsigned char b5:1; + unsigned char b6:1; + unsigned char b7:1; +} BitField; + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +BitField B100A __attribute__ ((__BELOW100__)); +unsigned char *pA = (unsigned char *) &B100A; +BitField B100B __attribute__ ((__BELOW100__)); +unsigned char *pB = (unsigned char *) &B100B; + +char * +Do (void) +{ + if (!B100A.b7) + { + if (!B100B.b7) + return "Fail"; + else + return "Success"; + } + else + return "Fail"; +} + +int +main (void) +{ + *pA = 0x34; + *pB = 0xcb; + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/24_set_b100w_bitfield_0.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/24_set_b100w_bitfield_0.c new file mode 100644 index 000000000..d2fb58096 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/24_set_b100w_bitfield_0.c @@ -0,0 +1,40 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "set1 B100,#0" } } */ + +typedef struct +{ + unsigned short b0:1; + unsigned short b1:1; + unsigned short b2:1; + unsigned short b3:1; + unsigned short b4:1; + unsigned short b5:1; + unsigned short b6:1; + unsigned short b7:1; + unsigned short b8:1; + unsigned short b9:1; + unsigned short b10:1; + unsigned short b11:1; + unsigned short b12:1; + unsigned short b13:1; + unsigned short b14:1; + unsigned short b15:1; +} BitField; + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +BitField B100 __attribute__ ((__BELOW100__)); +unsigned short *p = (unsigned short *) &B100; + +void +Do (void) +{ + B100.b0 = 1; +} + +int +main (void) +{ + *p = 0x1234; + Do (); + return (*p == 0x1235) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/24_set_b100w_bitfield_7.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/24_set_b100w_bitfield_7.c new file mode 100644 index 000000000..148253440 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/24_set_b100w_bitfield_7.c @@ -0,0 +1,40 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "set1 B100,#7" } } */ + +typedef struct +{ + unsigned short b0:1; + unsigned short b1:1; + unsigned short b2:1; + unsigned short b3:1; + unsigned short b4:1; + unsigned short b5:1; + unsigned short b6:1; + unsigned short b7:1; + unsigned short b8:1; + unsigned short b9:1; + unsigned short b10:1; + unsigned short b11:1; + unsigned short b12:1; + unsigned short b13:1; + unsigned short b14:1; + unsigned short b15:1; +} BitField; + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +BitField B100 __attribute__ ((__BELOW100__)); +unsigned short *p = (unsigned short *) &B100; + +void +Do (void) +{ + B100.b7 = 1; +} + +int +main (void) +{ + *p = 0x1234; + Do (); + return (*p == 0x12b4) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/24_set_b100w_bitfield_8.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/24_set_b100w_bitfield_8.c new file mode 100644 index 000000000..ce495b3ec --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/24_set_b100w_bitfield_8.c @@ -0,0 +1,40 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "set1 B100\\+1,#0" } } */ + +typedef struct +{ + unsigned short b0:1; + unsigned short b1:1; + unsigned short b2:1; + unsigned short b3:1; + unsigned short b4:1; + unsigned short b5:1; + unsigned short b6:1; + unsigned short b7:1; + unsigned short b8:1; + unsigned short b9:1; + unsigned short b10:1; + unsigned short b11:1; + unsigned short b12:1; + unsigned short b13:1; + unsigned short b14:1; + unsigned short b15:1; +} BitField; + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +BitField B100 __attribute__ ((__BELOW100__)); +unsigned short *p = (unsigned short *) &B100; + +void +Do (void) +{ + B100.b8 = 1; +} + +int +main (void) +{ + *p = 0x1234; + Do (); + return (*p == 0x1334) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/24_set_b100w_bitfield_f.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/24_set_b100w_bitfield_f.c new file mode 100644 index 000000000..057f2d023 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/24_set_b100w_bitfield_f.c @@ -0,0 +1,40 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "set1 B100\\+1,#7" } } */ + +typedef struct +{ + unsigned short b0:1; + unsigned short b1:1; + unsigned short b2:1; + unsigned short b3:1; + unsigned short b4:1; + unsigned short b5:1; + unsigned short b6:1; + unsigned short b7:1; + unsigned short b8:1; + unsigned short b9:1; + unsigned short b10:1; + unsigned short b11:1; + unsigned short b12:1; + unsigned short b13:1; + unsigned short b14:1; + unsigned short b15:1; +} BitField; + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +BitField B100 __attribute__ ((__BELOW100__)); +unsigned short *p = (unsigned short *) &B100; + +void +Do (void) +{ + B100.b15 = 1; +} + +int +main (void) +{ + *p = 0x1234; + Do (); + return (*p == 0x9234) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/25_clr_b100w_bitfield_0.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/25_clr_b100w_bitfield_0.c new file mode 100644 index 000000000..f32a16bd9 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/25_clr_b100w_bitfield_0.c @@ -0,0 +1,40 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "clr1 B100,#0" } } */ + +typedef struct +{ + unsigned short b0:1; + unsigned short b1:1; + unsigned short b2:1; + unsigned short b3:1; + unsigned short b4:1; + unsigned short b5:1; + unsigned short b6:1; + unsigned short b7:1; + unsigned short b8:1; + unsigned short b9:1; + unsigned short b10:1; + unsigned short b11:1; + unsigned short b12:1; + unsigned short b13:1; + unsigned short b14:1; + unsigned short b15:1; +} BitField; + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +BitField B100 __attribute__ ((__BELOW100__)); +unsigned short *p = (unsigned short *) &B100; + +void +Do (void) +{ + B100.b0 = 0; +} + +int +main (void) +{ + *p = 0xedcb; + Do (); + return (*p == 0xedca) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/25_clr_b100w_bitfield_7.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/25_clr_b100w_bitfield_7.c new file mode 100644 index 000000000..b123c5e3e --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/25_clr_b100w_bitfield_7.c @@ -0,0 +1,40 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "clr1 B100,#7" } } */ + +typedef struct +{ + unsigned short b0:1; + unsigned short b1:1; + unsigned short b2:1; + unsigned short b3:1; + unsigned short b4:1; + unsigned short b5:1; + unsigned short b6:1; + unsigned short b7:1; + unsigned short b8:1; + unsigned short b9:1; + unsigned short b10:1; + unsigned short b11:1; + unsigned short b12:1; + unsigned short b13:1; + unsigned short b14:1; + unsigned short b15:1; +} BitField; + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +BitField B100 __attribute__ ((__BELOW100__)); +unsigned short *p = (unsigned short *) &B100; + +void +Do (void) +{ + B100.b7 = 0; +} + +int +main (void) +{ + *p = 0xedcb; + Do (); + return (*p == 0xed4b) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/25_clr_b100w_bitfield_8.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/25_clr_b100w_bitfield_8.c new file mode 100644 index 000000000..ed923a1d0 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/25_clr_b100w_bitfield_8.c @@ -0,0 +1,40 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "clr1 B100\\+1,#0" } } */ + +typedef struct +{ + unsigned short b0:1; + unsigned short b1:1; + unsigned short b2:1; + unsigned short b3:1; + unsigned short b4:1; + unsigned short b5:1; + unsigned short b6:1; + unsigned short b7:1; + unsigned short b8:1; + unsigned short b9:1; + unsigned short b10:1; + unsigned short b11:1; + unsigned short b12:1; + unsigned short b13:1; + unsigned short b14:1; + unsigned short b15:1; +} BitField; + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +BitField B100 __attribute__ ((__BELOW100__)); +unsigned short *p = (unsigned short *) &B100; + +void +Do (void) +{ + B100.b8 = 0; +} + +int +main (void) +{ + *p = 0xedcb; + Do (); + return (*p == 0xeccb) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/25_clr_b100w_bitfield_f.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/25_clr_b100w_bitfield_f.c new file mode 100644 index 000000000..2e0411519 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/25_clr_b100w_bitfield_f.c @@ -0,0 +1,40 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "clr1 B100\\+1,#7" } } */ + +typedef struct +{ + unsigned short b0:1; + unsigned short b1:1; + unsigned short b2:1; + unsigned short b3:1; + unsigned short b4:1; + unsigned short b5:1; + unsigned short b6:1; + unsigned short b7:1; + unsigned short b8:1; + unsigned short b9:1; + unsigned short b10:1; + unsigned short b11:1; + unsigned short b12:1; + unsigned short b13:1; + unsigned short b14:1; + unsigned short b15:1; +} BitField; + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +BitField B100 __attribute__ ((__BELOW100__)); +unsigned short *p = (unsigned short *) &B100; + +void +Do (void) +{ + B100.b15 = 0; +} + +int +main (void) +{ + *p = 0xedcb; + Do (); + return (*p == 0x6dcb) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/26_if1_b100w_bitfield_0.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/26_if1_b100w_bitfield_0.c new file mode 100644 index 000000000..223de1284 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/26_if1_b100w_bitfield_0.c @@ -0,0 +1,51 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "b\[np\] B100A,#0," } } */ +/* { dg-final { scan-assembler "b\[np\] B100B,#0," } } */ + +typedef struct +{ + unsigned short b0:1; + unsigned short b1:1; + unsigned short b2:1; + unsigned short b3:1; + unsigned short b4:1; + unsigned short b5:1; + unsigned short b6:1; + unsigned short b7:1; + unsigned short b8:1; + unsigned short b9:1; + unsigned short b10:1; + unsigned short b11:1; + unsigned short b12:1; + unsigned short b13:1; + unsigned short b14:1; + unsigned short b15:1; +} BitField; + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +BitField B100A __attribute__ ((__BELOW100__)); +unsigned short *pA = (unsigned short *) &B100A; +BitField B100B __attribute__ ((__BELOW100__)); +unsigned short *pB = (unsigned short *) &B100B; + +char * +Do (void) +{ + if (B100A.b0) + { + if (B100B.b0) + return "Fail"; + else + return "Success"; + } + else + return "Fail"; +} + +int +main (void) +{ + *pA = 0xedcb; + *pB = 0x1234; + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/26_if1_b100w_bitfield_3.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/26_if1_b100w_bitfield_3.c new file mode 100644 index 000000000..83b0a8a15 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/26_if1_b100w_bitfield_3.c @@ -0,0 +1,51 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "b\[np\] B100A,#3," } } */ +/* { dg-final { scan-assembler "b\[np\] B100B,#3," } } */ + +typedef struct +{ + unsigned short b0:1; + unsigned short b1:1; + unsigned short b2:1; + unsigned short b3:1; + unsigned short b4:1; + unsigned short b5:1; + unsigned short b6:1; + unsigned short b7:1; + unsigned short b8:1; + unsigned short b9:1; + unsigned short b10:1; + unsigned short b11:1; + unsigned short b12:1; + unsigned short b13:1; + unsigned short b14:1; + unsigned short b15:1; +} BitField; + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +BitField B100A __attribute__ ((__BELOW100__)); +unsigned short *pA = (unsigned short *) &B100A; +BitField B100B __attribute__ ((__BELOW100__)); +unsigned short *pB = (unsigned short *) &B100B; + +char * +Do (void) +{ + if (B100A.b3) + { + if (B100B.b3) + return "Fail"; + else + return "Success"; + } + else + return "Fail"; +} + +int +main (void) +{ + *pA = 0xedcb; + *pB = 0x1234; + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/26_if1_b100w_bitfield_7.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/26_if1_b100w_bitfield_7.c new file mode 100644 index 000000000..89e71b89f --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/26_if1_b100w_bitfield_7.c @@ -0,0 +1,51 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "b\[np\] B100A,#7," } } */ +/* { dg-final { scan-assembler "b\[np\] B100B,#7," } } */ + +typedef struct +{ + unsigned short b0:1; + unsigned short b1:1; + unsigned short b2:1; + unsigned short b3:1; + unsigned short b4:1; + unsigned short b5:1; + unsigned short b6:1; + unsigned short b7:1; + unsigned short b8:1; + unsigned short b9:1; + unsigned short b10:1; + unsigned short b11:1; + unsigned short b12:1; + unsigned short b13:1; + unsigned short b14:1; + unsigned short b15:1; +} BitField; + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +BitField B100A __attribute__ ((__BELOW100__)); +unsigned short *pA = (unsigned short *) &B100A; +BitField B100B __attribute__ ((__BELOW100__)); +unsigned short *pB = (unsigned short *) &B100B; + +char * +Do (void) +{ + if (B100A.b7) + { + if (B100B.b7) + return "Fail"; + else + return "Success"; + } + else + return "Fail"; +} + +int +main (void) +{ + *pA = 0xedcb; + *pB = 0x1234; + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/26_if1_b100w_bitfield_8.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/26_if1_b100w_bitfield_8.c new file mode 100644 index 000000000..044541bfe --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/26_if1_b100w_bitfield_8.c @@ -0,0 +1,51 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "b\[np\] B100A\\+1,#0," } } */ +/* { dg-final { scan-assembler "b\[np\] B100B\\+1,#0," } } */ + +typedef struct +{ + unsigned short b0:1; + unsigned short b1:1; + unsigned short b2:1; + unsigned short b3:1; + unsigned short b4:1; + unsigned short b5:1; + unsigned short b6:1; + unsigned short b7:1; + unsigned short b8:1; + unsigned short b9:1; + unsigned short b10:1; + unsigned short b11:1; + unsigned short b12:1; + unsigned short b13:1; + unsigned short b14:1; + unsigned short b15:1; +} BitField; + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +BitField B100A __attribute__ ((__BELOW100__)); +unsigned short *pA = (unsigned short *) &B100A; +BitField B100B __attribute__ ((__BELOW100__)); +unsigned short *pB = (unsigned short *) &B100B; + +char * +Do (void) +{ + if (B100A.b8) + { + if (B100B.b8) + return "Fail"; + else + return "Success"; + } + else + return "Fail"; +} + +int +main (void) +{ + *pA = 0xedcb; + *pB = 0x1234; + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/26_if1_b100w_bitfield_b.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/26_if1_b100w_bitfield_b.c new file mode 100644 index 000000000..e36934f8d --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/26_if1_b100w_bitfield_b.c @@ -0,0 +1,51 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "b\[np\] B100A\\+1,#3," } } */ +/* { dg-final { scan-assembler "b\[np\] B100B\\+1,#3," } } */ + +typedef struct +{ + unsigned short b0:1; + unsigned short b1:1; + unsigned short b2:1; + unsigned short b3:1; + unsigned short b4:1; + unsigned short b5:1; + unsigned short b6:1; + unsigned short b7:1; + unsigned short b8:1; + unsigned short b9:1; + unsigned short b10:1; + unsigned short b11:1; + unsigned short b12:1; + unsigned short b13:1; + unsigned short b14:1; + unsigned short b15:1; +} BitField; + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +BitField B100A __attribute__ ((__BELOW100__)); +unsigned short *pA = (unsigned short *) &B100A; +BitField B100B __attribute__ ((__BELOW100__)); +unsigned short *pB = (unsigned short *) &B100B; + +char * +Do (void) +{ + if (B100A.b11) + { + if (B100B.b11) + return "Fail"; + else + return "Success"; + } + else + return "Fail"; +} + +int +main (void) +{ + *pA = 0xedcb; + *pB = 0x1234; + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/26_if1_b100w_bitfield_f.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/26_if1_b100w_bitfield_f.c new file mode 100644 index 000000000..90d0bbd9b --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/26_if1_b100w_bitfield_f.c @@ -0,0 +1,51 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "b\[np\] B100A\\+1,#7," } } */ +/* { dg-final { scan-assembler "b\[np\] B100B\\+1,#7," } } */ + +typedef struct +{ + unsigned short b0:1; + unsigned short b1:1; + unsigned short b2:1; + unsigned short b3:1; + unsigned short b4:1; + unsigned short b5:1; + unsigned short b6:1; + unsigned short b7:1; + unsigned short b8:1; + unsigned short b9:1; + unsigned short b10:1; + unsigned short b11:1; + unsigned short b12:1; + unsigned short b13:1; + unsigned short b14:1; + unsigned short b15:1; +} BitField; + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +BitField B100A __attribute__ ((__BELOW100__)); +unsigned short *pA = (unsigned short *) &B100A; +BitField B100B __attribute__ ((__BELOW100__)); +unsigned short *pB = (unsigned short *) &B100B; + +char * +Do (void) +{ + if (B100A.b15) + { + if (B100B.b15) + return "Fail"; + else + return "Success"; + } + else + return "Fail"; +} + +int +main (void) +{ + *pA = 0xedcb; + *pB = 0x1234; + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/27_if0_b100w_bitfield_0.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/27_if0_b100w_bitfield_0.c new file mode 100644 index 000000000..a81359ca3 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/27_if0_b100w_bitfield_0.c @@ -0,0 +1,51 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "b\[np\] B100A,#0," } } */ +/* { dg-final { scan-assembler "b\[np\] B100B,#0," } } */ + +typedef struct +{ + unsigned short b0:1; + unsigned short b1:1; + unsigned short b2:1; + unsigned short b3:1; + unsigned short b4:1; + unsigned short b5:1; + unsigned short b6:1; + unsigned short b7:1; + unsigned short b8:1; + unsigned short b9:1; + unsigned short b10:1; + unsigned short b11:1; + unsigned short b12:1; + unsigned short b13:1; + unsigned short b14:1; + unsigned short b15:1; +} BitField; + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +BitField B100A __attribute__ ((__BELOW100__)); +unsigned short *pA = (unsigned short *) &B100A; +BitField B100B __attribute__ ((__BELOW100__)); +unsigned short *pB = (unsigned short *) &B100B; + +char * +Do (void) +{ + if (!B100A.b0) + { + if (!B100B.b0) + return "Fail"; + else + return "Success"; + } + else + return "Fail"; +} + +int +main (void) +{ + *pA = 0x1234; + *pB = 0xedcb; + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/27_if0_b100w_bitfield_3.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/27_if0_b100w_bitfield_3.c new file mode 100644 index 000000000..d9eff1abb --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/27_if0_b100w_bitfield_3.c @@ -0,0 +1,51 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "b\[np\] B100A,#3," } } */ +/* { dg-final { scan-assembler "b\[np\] B100B,#3," } } */ + +typedef struct +{ + unsigned short b0:1; + unsigned short b1:1; + unsigned short b2:1; + unsigned short b3:1; + unsigned short b4:1; + unsigned short b5:1; + unsigned short b6:1; + unsigned short b7:1; + unsigned short b8:1; + unsigned short b9:1; + unsigned short b10:1; + unsigned short b11:1; + unsigned short b12:1; + unsigned short b13:1; + unsigned short b14:1; + unsigned short b15:1; +} BitField; + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +BitField B100A __attribute__ ((__BELOW100__)); +unsigned short *pA = (unsigned short *) &B100A; +BitField B100B __attribute__ ((__BELOW100__)); +unsigned short *pB = (unsigned short *) &B100B; + +char * +Do (void) +{ + if (!B100A.b3) + { + if (!B100B.b3) + return "Fail"; + else + return "Success"; + } + else + return "Fail"; +} + +int +main (void) +{ + *pA = 0x1234; + *pB = 0xedcb; + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/27_if0_b100w_bitfield_7.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/27_if0_b100w_bitfield_7.c new file mode 100644 index 000000000..1d643ea02 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/27_if0_b100w_bitfield_7.c @@ -0,0 +1,51 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "b\[np\] B100A,#7," } } */ +/* { dg-final { scan-assembler "b\[np\] B100B,#7," } } */ + +typedef struct +{ + unsigned short b0:1; + unsigned short b1:1; + unsigned short b2:1; + unsigned short b3:1; + unsigned short b4:1; + unsigned short b5:1; + unsigned short b6:1; + unsigned short b7:1; + unsigned short b8:1; + unsigned short b9:1; + unsigned short b10:1; + unsigned short b11:1; + unsigned short b12:1; + unsigned short b13:1; + unsigned short b14:1; + unsigned short b15:1; +} BitField; + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +BitField B100A __attribute__ ((__BELOW100__)); +unsigned short *pA = (unsigned short *) &B100A; +BitField B100B __attribute__ ((__BELOW100__)); +unsigned short *pB = (unsigned short *) &B100B; + +char * +Do (void) +{ + if (!B100A.b7) + { + if (!B100B.b7) + return "Fail"; + else + return "Success"; + } + else + return "Fail"; +} + +int +main (void) +{ + *pA = 0x1234; + *pB = 0xedcb; + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/27_if0_b100w_bitfield_8.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/27_if0_b100w_bitfield_8.c new file mode 100644 index 000000000..5a2b67863 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/27_if0_b100w_bitfield_8.c @@ -0,0 +1,51 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "b\[np\] B100A\\+1,#0," } } */ +/* { dg-final { scan-assembler "b\[np\] B100B\\+1,#0," } } */ + +typedef struct +{ + unsigned short b0:1; + unsigned short b1:1; + unsigned short b2:1; + unsigned short b3:1; + unsigned short b4:1; + unsigned short b5:1; + unsigned short b6:1; + unsigned short b7:1; + unsigned short b8:1; + unsigned short b9:1; + unsigned short b10:1; + unsigned short b11:1; + unsigned short b12:1; + unsigned short b13:1; + unsigned short b14:1; + unsigned short b15:1; +} BitField; + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +BitField B100A __attribute__ ((__BELOW100__)); +unsigned short *pA = (unsigned short *) &B100A; +BitField B100B __attribute__ ((__BELOW100__)); +unsigned short *pB = (unsigned short *) &B100B; + +char * +Do (void) +{ + if (!B100A.b8) + { + if (!B100B.b8) + return "Fail"; + else + return "Success"; + } + else + return "Fail"; +} + +int +main (void) +{ + *pA = 0x1234; + *pB = 0xedcb; + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/27_if0_b100w_bitfield_b.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/27_if0_b100w_bitfield_b.c new file mode 100644 index 000000000..87f760b22 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/27_if0_b100w_bitfield_b.c @@ -0,0 +1,51 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "b\[np\] B100A\\+1,#3," } } */ +/* { dg-final { scan-assembler "b\[np\] B100B\\+1,#3," } } */ + +typedef struct +{ + unsigned short b0:1; + unsigned short b1:1; + unsigned short b2:1; + unsigned short b3:1; + unsigned short b4:1; + unsigned short b5:1; + unsigned short b6:1; + unsigned short b7:1; + unsigned short b8:1; + unsigned short b9:1; + unsigned short b10:1; + unsigned short b11:1; + unsigned short b12:1; + unsigned short b13:1; + unsigned short b14:1; + unsigned short b15:1; +} BitField; + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +BitField B100A __attribute__ ((__BELOW100__)); +unsigned short *pA = (unsigned short *) &B100A; +BitField B100B __attribute__ ((__BELOW100__)); +unsigned short *pB = (unsigned short *) &B100B; + +char * +Do (void) +{ + if (!B100A.b11) + { + if (!B100B.b11) + return "Fail"; + else + return "Success"; + } + else + return "Fail"; +} + +int +main (void) +{ + *pA = 0x1234; + *pB = 0xedcb; + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/bss_below100/27_if0_b100w_bitfield_f.c b/gcc/testsuite/gcc.target/xstormy16/bss_below100/27_if0_b100w_bitfield_f.c new file mode 100644 index 000000000..1950ca27c --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/bss_below100/27_if0_b100w_bitfield_f.c @@ -0,0 +1,51 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "b\[np\] B100A\\+1,#7," } } */ +/* { dg-final { scan-assembler "b\[np\] B100B\\+1,#7," } } */ + +typedef struct +{ + unsigned short b0:1; + unsigned short b1:1; + unsigned short b2:1; + unsigned short b3:1; + unsigned short b4:1; + unsigned short b5:1; + unsigned short b6:1; + unsigned short b7:1; + unsigned short b8:1; + unsigned short b9:1; + unsigned short b10:1; + unsigned short b11:1; + unsigned short b12:1; + unsigned short b13:1; + unsigned short b14:1; + unsigned short b15:1; +} BitField; + +char acDummy[0xf0] __attribute__ ((__BELOW100__)); +BitField B100A __attribute__ ((__BELOW100__)); +unsigned short *pA = (unsigned short *) &B100A; +BitField B100B __attribute__ ((__BELOW100__)); +unsigned short *pB = (unsigned short *) &B100B; + +char * +Do (void) +{ + if (!B100A.b15) + { + if (!B100B.b15) + return "Fail"; + else + return "Success"; + } + else + return "Fail"; +} + +int +main (void) +{ + *pA = 0x1234; + *pB = 0xedcb; + return Do ()[0] == 'F'; +} |