diff options
author | nickc <nickc@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-12-08 11:15:24 +0000 |
---|---|---|
committer | nickc <nickc@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-12-08 11:15:24 +0000 |
commit | 86b097cd8e1ad309be46ab674ec37aabbda0f145 (patch) | |
tree | 74a079d7e1704312ca22f239065ff1bee51adf5e /gcc/testsuite/gcc.target | |
parent | d90aa65d9fba4793cad1daf99f044800f6d1390c (diff) | |
download | gcc-86b097cd8e1ad309be46ab674ec37aabbda0f145.tar.gz |
Add new tests for xstormy16
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@91870 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.target')
207 files changed, 7109 insertions, 12 deletions
diff --git a/gcc/testsuite/gcc.target/xstormy16/below100.S b/gcc/testsuite/gcc.target/xstormy16/below100.S new file mode 100644 index 00000000000..25f9bc8caf9 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/below100.S @@ -0,0 +1,188 @@ +/******************************************************************
+*** ***
+*** crt0 for __BELOW100__ attribute test with SID ***
+*** ***
+******************************************************************/
+
+ /*************************************/
+ /** Interrupt vectors at 0x8000 **/
+ /*************************************/
+ .section .int_vec,"ax"
+ .global _start
+ .align 1
+_start:
+ jmpf _int_reset
+ //jmpf _int_basetimer
+ //jmpf _int_timer0
+ //jmpf _int_timer1
+ //jmpf _int_irq_4
+ //jmpf _int_irq_5
+ //jmpf _int_port0
+ //jmpf _int_port1
+ //jmpf _int_irq_8
+ //jmpf _int_irq_9
+ //jmpf _int_irq_a
+ //jmpf _int_irq_b
+ //jmpf _int_irq_c
+ //jmpf _int_irq_d
+ //jmpf _int_irq_e
+ //jmpf _int_irq_f
+ /*************************************/
+ /** reset code **/
+ /*************************************/
+ .text
+_int_reset:
+ /*************************************/
+ /** setup stack pointer **/
+ /*************************************/
+ mov sp,#__stack
+ /*************************************/
+ /** zero .bss section **/
+ /*************************************/
+ mov r0,#__bss_start
+ mov r1,#__bss_end
+ mov r2,#0
+1: mov.w (r0++),r2
+ blt r0,r1,1b
+ /*************************************/
+ /** copy inital value for .data **/
+ /*************************************/
+ mov r1,#__data_start
+ mov r3,#__data_end
+ mov r0,#@lo(__rdata)
+ mov r8,#@hi(__rdata)
+2: movf.w r2,(r0++)
+ bnz r0,#0,3f
+ add r8,#1
+3: mov.w (r1++),r2
+ blt r1,r3,2b
+ /*************************************/
+ /** call hardware init routine **/
+ /*************************************/
+ callf _hwinit
+ /*************************************/
+ /** call initializaton routines **/
+ /*************************************/
+ callf _init
+ /*************************************/
+ /** setup fini routines to be **/
+ /** called from exit **/
+ /*************************************/
+ mov r2,#@fptr(_fini)
+ callf atexit
+ /*************************************/
+ /** call main() with empty **/
+ /** argc/argv/envp **/
+ /*************************************/
+ mov r2,#0
+ mov r3,#0
+ mov r4,#0
+ callf main
+ /*************************************/
+ /** return from main() **/
+ /*************************************/
+ callf exit
+ /*************************************/
+ /** should never reach this code **/
+ /*************************************/
+ jmpf _start
+ /*************************************/
+ /** default h/w initialize routine **/
+ /** and default _init/_finit for **/
+ /** -nostartfiles option **/
+ /*************************************/
+ .globl _hwinit
+ .weak _hwinit
+_hwinit:
+ .globl _init
+ .weak _init
+_init:
+ .globl _fini
+ .weak _fini
+_fini:
+ ret
+
+/******************************************************************
+*******************************************************************
+*** ***
+*** Chip information data for LC59_32K ***
+*** Written by T.Matsukawa ***
+*** ***
+*******************************************************************
+******************************************************************/
+
+ /*************************************/
+ /** Define convenient macros **/
+ /*************************************/
+#define BCD(x) (((x)/10)%10)*0x10+((x)%10)
+#define BCD4(x) BCD((x)/100),BCD(x)
+#define BCD6(x) BCD((x)/10000),BCD((x)/100),BCD(x)
+ /*************************************/
+ /** Define memory sizes **/
+ /*************************************/
+#define RAM_SIZE 0x7E00
+#define ROM_SIZE 0x78000
+#define VRAM_SIZE 0x0000
+#define VRAM_ROW 0
+#define VRAM_COLUMN 0
+#define CGROM_SIZE 0x0000
+#define PROTECT_SIZE 0x0000
+
+ /*************************************/
+ /** section ".chip_info" **/
+ /*************************************/
+ .section .chip_info,"a"
+ .space 0xb8,0x00
+ /*************************************/
+ /** B8-BB : User option address **/
+ /*************************************/
+ .word 0x00000
+ .global __reset_vector
+#if 0x00000==0
+ .equ __reset_vector,0x08000
+#else
+ .equ __reset_vector,0x00000
+#endif
+ /*************************************/
+ /** BC-BF : Flash Protect address **/
+ /*************************************/
+#if PROTECT_SIZE==0
+ .word 0x00000000
+#else
+ .word 0x08000+ROM_SIZE-PROTECT_SIZE
+#endif
+ /*************************************/
+ /** C0-CF : Fixed string **/
+ /*************************************/
+ .ascii "CHIPINFORMATION"
+1: .space (0xd0-1b),0x00
+ /*************************************/
+ /** D0-DF : Chipname **/
+ /*************************************/
+ .ascii "LC59_32K"
+2: .space (0xe0-2b),0x00
+ /*************************************/
+ /** E0-E1 : Format version(BCD4) **/
+ /*************************************/
+ .byte 0x10, 0x00
+ .space 6, 0x00
+ /*************************************/
+ /** E8-F5 : Memory sizes **/
+ /*************************************/
+ .byte BCD4(ROM_SIZE/1024)
+ .byte BCD6(RAM_SIZE)
+ .byte BCD6(VRAM_SIZE)
+ .byte BCD4(VRAM_ROW)
+ .byte BCD4(VRAM_COLUMN)
+ .byte BCD4(CGROM_SIZE/1024)
+ .space 3, 0x00
+ /*************************************/
+ /** F9 : Package type **/
+ /*************************************/
+ .byte 0xff
+ .space 6, 0x00
+
+ /*************************************/
+ /** In order to link BIOS in library**/
+ /*************************************/
+ .equ dummy,__bios_entry
diff --git a/gcc/testsuite/gcc.target/xstormy16/below100.ld b/gcc/testsuite/gcc.target/xstormy16/below100.ld new file mode 100644 index 00000000000..91c3e43f70f --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/below100.ld @@ -0,0 +1,192 @@ +/****************************************************************** +******************************************************************* +*** *** +*** Linker script for xstormy16-elf-gcc *** +*** For SID RAM=0x7E00 *** +*** ROM=0x78000 *** +*** *** +******************************************************************* +******************************************************************/ + +OUTPUT_FORMAT("elf32-xstormy16", "elf32-xstormy16", "elf32-xstormy16") +OUTPUT_ARCH(xstormy16) +ENTRY(_start) +SEARCH_DIR( . ) +GROUP(-lc -lsim -lgcc) +PROVIDE( __target_package = 0xff); + +__malloc_start = 0x7E00; + +MEMORY +{ + RAM (w) : ORIGIN = 0x00000, LENGTH = 0x07E00 + CHIP (r) : ORIGIN = 0x07f00, LENGTH = 0x00100 + ROM (!w) : ORIGIN = 0x08000, LENGTH = 0x78000 +} + +SECTIONS +{ + /* Zero initialized data with the below100 attribute. */ + .bss_below100 : { + SHORT(0) + __bss_start = .; + *(.bss_below100) + *(.bss_below100.*) + . = ALIGN(2); + } > RAM + + /* Non-zero initialized data with the below100 attribute. */ + .data_below100 : AT ( __rdata ) { + __data_start = . ; + *(.data_0) + *(.data_below100) + *(.data_below100.*) + . = ALIGN(2); + } > RAM = 0 + + /* Normal non-zero initialized data. */ + .data : AT ( __rdata + SIZEOF(.data_below100) ) { + *(.data) + *(.data.*) + *(.gnu.linkonce.d.*) + SORT(CONSTRUCTORS) + . = ALIGN(2); + __data_end = . ; + } > RAM =0 + + /* Normal zero initialized data. */ + .bss : AT (LOADADDR(.data) + SIZEOF(.data)) { + *(.dynbss) + *(.bss) + *(.bss.*) + *(.gnu.linkonce.b.*) + *(COMMON) + . = ALIGN(2); + __bss_end = .; + } > RAM + + /* The top of stack. */ + __stack = .; + + /* Target chip info. */ + .chip_info : { + KEEP(*(.chip_info)) + } > CHIP =0 + + /* Reset and interrupt vectors at 8000. */ + .int_vec : { + KEEP(*(.int_vec)) + } > ROM =0 + + /* Read only data. */ + .rodata : { + *(.rodata) + *(.rodata.*) + *(.gnu.linkonce.r.*) + } > ROM =0 + + /* C++ Construcrtors and destructors. */ + .ctors : { + KEEP (*crtbegin.o(.ctors)) + KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors)) + KEEP (*(SORT(.ctors.*))) + KEEP (*(.ctors)) + } > ROM =0 + + .dtors : { + KEEP (*crtbegin.o(.dtors)) + KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors)) + KEEP (*(SORT(.dtors.*))) + KEEP (*(.dtors)) + } > ROM =0 + + /* Pointer lookup table.. */ + .plt : { + *(.plt) + } > ROM =0 + + /* Other information. */ + .jcr : { + KEEP (*(.jcr)) + } > ROM =0 + + .eh_frame : { + KEEP (*(.eh_frame)) + } > ROM =0 + + .gcc_except_table : { + KEEP (*(.gcc_except_table)) + } > ROM =0 + + /* Initialization values for data. */ + .data_init (NOLOAD) : { + __rdata = .; + . += SIZEOF(.data_below100); + . += SIZEOF(.data); + . += SIZEOF(.bss); + } > ROM + + /* Executable code. */ + .text : { + *(.text) + *(.text.*) + *(.stub) + *(.gnu.warning) + *(.gnu.linkonce.t.*) + } > ROM =0 + + /* Startup/finish code. */ + .init : { + KEEP (*crti.o(.init)) + KEEP (*(EXCLUDE_FILE (*crtn.o ) .init)) + KEEP (*(SORT(.init.*))) + KEEP (*(.init)) + } > ROM =0 + + .fini : { + KEEP (*crti.o(.fini)) + KEEP (*(EXCLUDE_FILE (*crtn.o ) .fini)) + KEEP (*(SORT(.fini.*))) + KEEP (*(.fini)) + } > ROM =0 + + /* Stab debugging sections. */ + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } + .stab.indexstr 0 : { *(.stab.indexstr) } + .comment 0 : { *(.comment) } + + /* DWARF debug sections. */ + /* Symbols in the DWARF debugging sections are relative to + the beginning of the section so we begin them at 0. */ + + /* DWARF 1. */ + .debug 0 : { *(.debug) } + .line 0 : { *(.line) } + + /* GNU DWARF 1 extensions. */ + .debug_srcinfo 0 : { *(.debug_srcinfo) } + .debug_sfnames 0 : { *(.debug_sfnames) } + + /* DWARF 1.1 and DWARF 2. */ + .debug_aranges 0 : { *(.debug_aranges) } + .debug_pubnames 0 : { *(.debug_pubnames) } + + /* DWARF 2. */ + .debug_info 0 : { *(.debug_info) *(.gnu.linkonce.wi.*) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_line 0 : { *(.debug_line) } + .debug_frame 0 : { *(.debug_frame) } + .debug_str 0 : { *(.debug_str) } + .debug_loc 0 : { *(.debug_loc) } + .debug_macinfo 0 : { *(.debug_macinfo) } + + /* SGI/MIPS DWARF 2 extensions. */ + .debug_weaknames 0 : { *(.debug_weaknames) } + .debug_funcnames 0 : { *(.debug_funcnames) } + .debug_typenames 0 : { *(.debug_typenames) } + .debug_varnames 0 : { *(.debug_varnames) } +} diff --git a/gcc/testsuite/gcc.target/xstormy16/below_100.c b/gcc/testsuite/gcc.target/xstormy16/below_100.c index dfa7e3bc92b..9433f2ad897 100644 --- a/gcc/testsuite/gcc.target/xstormy16/below_100.c +++ b/gcc/testsuite/gcc.target/xstormy16/below_100.c @@ -1,7 +1,7 @@ /* { dg-do compile } */ /* { dg-options "-O2" } */ /* { dg-final { scan-assembler "bn " } } */ -/* { dg-final { scan-assembler "bp " } } */ +/* { dg-final { scan-assembler "b\[np\] " } } */ unsigned short a_below __attribute__((__BELOW100__)); unsigned short b_below __attribute__((__BELOW100__)); diff --git a/gcc/testsuite/gcc.target/xstormy16/bp.c b/gcc/testsuite/gcc.target/xstormy16/bp.c index 5cab932d3db..26ca6a3b4ad 100644 --- a/gcc/testsuite/gcc.target/xstormy16/bp.c +++ b/gcc/testsuite/gcc.target/xstormy16/bp.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O2" } */ -/* { dg-final { scan-assembler "bp " } } */ +/* { dg-final { scan-assembler "b\[np\] " } } */ #define a_val (*((volatile unsigned char *) 0x7f14)) #define b_val (*((volatile unsigned char *) 0x7f10)) @@ -30,5 +30,3 @@ bar (void) return foo (); } - - 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 00000000000..2b4438c4c33 --- /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 00000000000..d011ffd664e --- /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 00000000000..bcc99118966 --- /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 00000000000..ab4748871ad --- /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 00000000000..e5f57e80325 --- /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 00000000000..b19d9bcf418 --- /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 00000000000..f0965f1107d --- /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 00000000000..8b14c43083c --- /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 00000000000..79c265a2434 --- /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 00000000000..d40e68f55e6 --- /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 00000000000..26b3711ea05 --- /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 00000000000..865ec549bd2 --- /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 00000000000..efbe1243cc8 --- /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 00000000000..81873954c1f --- /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 00000000000..3fc566aa98f --- /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 00000000000..bc90eaf953e --- /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 00000000000..9164d05df3c --- /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 00000000000..848c3241f14 --- /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 00000000000..f843d12af4d --- /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 00000000000..bba6dc9f48f --- /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 00000000000..634f2fc651c --- /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 00000000000..4b7d1bd7247 --- /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 00000000000..1c5d4c40244 --- /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 00000000000..5140c6caf85 --- /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 00000000000..fb6a1ba318b --- /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 00000000000..c6246291453 --- /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 00000000000..d1c3fbf569a --- /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 00000000000..b1045420357 --- /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 00000000000..8fbded125c8 --- /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 00000000000..ae97d96a809 --- /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 00000000000..07c6e94d57d --- /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 00000000000..f2dd3fba6ac --- /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 00000000000..af6eb6e1783 --- /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 00000000000..d50f8f82b77 --- /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 00000000000..28d5a39bb62 --- /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 00000000000..6a3f7025fbc --- /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 00000000000..240e472991f --- /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 00000000000..674e51a6469 --- /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 00000000000..3846a96d218 --- /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 00000000000..10174576f2d --- /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 00000000000..9c4135776ad --- /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 00000000000..86f0f22f137 --- /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 00000000000..0df2f55dde0 --- /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 00000000000..9acd8a6f9e3 --- /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 00000000000..3ddbc1a103c --- /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 00000000000..3c0802e1e38 --- /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 00000000000..d2fb5809643 --- /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 00000000000..14825344076 --- /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 00000000000..ce495b3ecdb --- /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 00000000000..057f2d0231f --- /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 00000000000..f32a16bd938 --- /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 00000000000..b123c5e3ef2 --- /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 00000000000..ed923a1d0ad --- /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 00000000000..2e041151985 --- /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 00000000000..223de1284e8 --- /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 00000000000..83b0a8a1525 --- /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 00000000000..89e71b89f76 --- /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 00000000000..044541bfe87 --- /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 00000000000..e36934f8d62 --- /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 00000000000..90d0bbd9bb1 --- /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 00000000000..a81359ca32c --- /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 00000000000..d9eff1abb15 --- /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 00000000000..1d643ea0217 --- /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 00000000000..5a2b67863f4 --- /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 00000000000..87f760b2220 --- /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 00000000000..1950ca27cdf --- /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'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/01_const_to_b100b.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/01_const_to_b100b.c new file mode 100644 index 00000000000..0ffc4bad8dc --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/01_const_to_b100b.c @@ -0,0 +1,19 @@ +/* { 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__)) = 0x34; +unsigned char *p = &B100; + +void +Do (void) +{ + B100 = 0x12; +} + +int +main (void) +{ + Do (); + return (*p == 0x12) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/02_const_to_b100w.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/02_const_to_b100w.c new file mode 100644 index 00000000000..e2ad793c9e5 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/02_const_to_b100w.c @@ -0,0 +1,19 @@ +/* { 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__)) = 0x9876; +unsigned short *p = &B100; + +void +Do (void) +{ + B100 = 0x1234; +} + +int +main (void) +{ + Do (); + return (*p == 0x1234) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/03_var_to_b100b.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/03_var_to_b100b.c new file mode 100644 index 00000000000..f78d18ab93b --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/03_var_to_b100b.c @@ -0,0 +1,21 @@ +/* { 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__)) = 0x34; +unsigned char *p = &B100; + +unsigned char yData = 0x12; + +void +Do (void) +{ + B100 = yData; +} + +int +main (void) +{ + Do (); + return (*p == 0x12) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/04_var_to_b100w.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/04_var_to_b100w.c new file mode 100644 index 00000000000..b9f3c55cda4 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/04_var_to_b100w.c @@ -0,0 +1,21 @@ +/* { 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__)) = 0x9876; +unsigned short *p = &B100; + +unsigned short wData = 0x1234; + +void +Do (void) +{ + B100 = wData; +} + +int +main (void) +{ + Do (); + return (*p == 0x1234) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/05_b100b_to_var.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/05_b100b_to_var.c new file mode 100644 index 00000000000..b2a0bd04c31 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/05_b100b_to_var.c @@ -0,0 +1,21 @@ +/* { 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__)) = 0x34; +unsigned char *p = &B100; + +unsigned char yData = 0x12; + +void +Do (void) +{ + yData = B100; +} + +int +main (void) +{ + Do (); + return (yData == 0x34) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/06_b100w_to_var.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/06_b100w_to_var.c new file mode 100644 index 00000000000..50a6dd2a1ea --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/06_b100w_to_var.c @@ -0,0 +1,21 @@ +/* { 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__)) = 0x3456; +unsigned short *p = &B100; + +unsigned short wData = 0x1234; + +void +Do (void) +{ + wData = B100; +} + +int +main (void) +{ + Do (); + return (wData == 0x3456) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/10_set_b100b_bit_0.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/10_set_b100b_bit_0.c new file mode 100644 index 00000000000..f81d26a3c2d --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/10_set_b100b_bit_0.c @@ -0,0 +1,19 @@ +/* { 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__)) = 0x34; +unsigned char *p = &B100; + +void +Do (void) +{ + B100 |= 0x01; +} + +int +main (void) +{ + Do (); + return (*p == 0x35) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/10_set_b100b_bit_7.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/10_set_b100b_bit_7.c new file mode 100644 index 00000000000..2c519132e31 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/10_set_b100b_bit_7.c @@ -0,0 +1,19 @@ +/* { 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__)) = 0x34; +unsigned char *p = &B100; + +void +Do (void) +{ + B100 |= 0x80; +} + +int +main (void) +{ + Do (); + return (*p == 0xb4) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/11_clr_b100b_bit_0.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/11_clr_b100b_bit_0.c new file mode 100644 index 00000000000..500f9baf411 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/11_clr_b100b_bit_0.c @@ -0,0 +1,19 @@ +/* { 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__)) = 0xcb; +unsigned char *p = &B100; + +void +Do (void) +{ + B100 &= ~0x01; +} + +int +main (void) +{ + Do (); + return (*p == 0xca) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/11_clr_b100b_bit_7.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/11_clr_b100b_bit_7.c new file mode 100644 index 00000000000..7c71f678974 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/11_clr_b100b_bit_7.c @@ -0,0 +1,19 @@ +/* { 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__)) = 0xcb; +unsigned char *p = &B100; + +void +Do (void) +{ + B100 &= ~0x80; +} + +int +main (void) +{ + Do (); + return (*p == 0x4b) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/12_if1_b100b_bit_0.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/12_if1_b100b_bit_0.c new file mode 100644 index 00000000000..10dee715117 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/12_if1_b100b_bit_0.c @@ -0,0 +1,29 @@ +/* { 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__)) = 0xcb; +unsigned char *pA = &B100A; +unsigned char B100B __attribute__ ((__BELOW100__)) = 0x34; +unsigned char *pB = &B100B; + +char * +Do (void) +{ + if (B100A & 0x01) + { + if (B100B & 0x01) + return "Fail"; + else + return "Success"; + } + else + return "Fail"; +} + +int +main (void) +{ + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/12_if1_b100b_bit_3.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/12_if1_b100b_bit_3.c new file mode 100644 index 00000000000..b36612409c8 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/12_if1_b100b_bit_3.c @@ -0,0 +1,29 @@ +/* { 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__)) = 0xcb; +unsigned char *pA = &B100A; +unsigned char B100B __attribute__ ((__BELOW100__)) = 0x34; +unsigned char *pB = &B100B; + +char * +Do (void) +{ + if (B100A & 0x08) + { + if (B100B & 0x08) + return "Fail"; + else + return "Success"; + } + else + return "Fail"; +} + +int +main (void) +{ + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/12_if1_b100b_bit_7.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/12_if1_b100b_bit_7.c new file mode 100644 index 00000000000..9906a663c42 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/12_if1_b100b_bit_7.c @@ -0,0 +1,29 @@ +/* { 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__)) = 0xcb; +unsigned char *pA = &B100A; +unsigned char B100B __attribute__ ((__BELOW100__)) = 0x34; +unsigned char *pB = &B100B; + +char * +Do (void) +{ + if (B100A & 0x80) + { + if (B100B & 0x80) + return "Fail"; + else + return "Success"; + } + else + return "Fail"; +} + +int +main (void) +{ + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/13_if0_b100b_bit_0.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/13_if0_b100b_bit_0.c new file mode 100644 index 00000000000..04cc929138b --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/13_if0_b100b_bit_0.c @@ -0,0 +1,29 @@ +/* { 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__)) = 0x34; +unsigned char *pA = &B100A; +unsigned char B100B __attribute__ ((__BELOW100__)) = 0xcb; +unsigned char *pB = &B100B; + +char * +Do (void) +{ + if (!(B100A & 0x01)) + { + if (!(B100B & 0x01)) + return "Fail"; + else + return "Success"; + } + else + return "Fail"; +} + +int +main (void) +{ + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/13_if0_b100b_bit_3.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/13_if0_b100b_bit_3.c new file mode 100644 index 00000000000..cbda60c274e --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/13_if0_b100b_bit_3.c @@ -0,0 +1,29 @@ +/* { 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__)) = 0x34; +unsigned char *pA = &B100A; +unsigned char B100B __attribute__ ((__BELOW100__)) = 0xcb; +unsigned char *pB = &B100B; + +char * +Do (void) +{ + if (!(B100A & 0x08)) + { + if (!(B100B & 0x08)) + return "Fail"; + else + return "Success"; + } + else + return "Fail"; +} + +int +main (void) +{ + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/13_if0_b100b_bit_7.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/13_if0_b100b_bit_7.c new file mode 100644 index 00000000000..49143469dee --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/13_if0_b100b_bit_7.c @@ -0,0 +1,29 @@ +/* { 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__)) = 0x34; +unsigned char *pA = &B100A; +unsigned char B100B __attribute__ ((__BELOW100__)) = 0xcb; +unsigned char *pB = &B100B; + +char * +Do (void) +{ + if (!(B100A & 0x80)) + { + if (!(B100B & 0x80)) + return "Fail"; + else + return "Success"; + } + else + return "Fail"; +} + +int +main (void) +{ + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/14_set_b100w_bit_0.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/14_set_b100w_bit_0.c new file mode 100644 index 00000000000..acce9e1d9fb --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/14_set_b100w_bit_0.c @@ -0,0 +1,19 @@ +/* { 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__)) = 0x1234; +unsigned short *p = &B100; + +void +Do (void) +{ + B100 |= 0x0001; +} + +int +main (void) +{ + Do (); + return (*p == 0x1235) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/14_set_b100w_bit_7.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/14_set_b100w_bit_7.c new file mode 100644 index 00000000000..35fe30f5d9c --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/14_set_b100w_bit_7.c @@ -0,0 +1,19 @@ +/* { 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__)) = 0x1234; +unsigned short *p = &B100; + +void +Do (void) +{ + B100 |= 0x0080; +} + +int +main (void) +{ + Do (); + return (*p == 0x12b4) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/14_set_b100w_bit_8.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/14_set_b100w_bit_8.c new file mode 100644 index 00000000000..cc337fc0426 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/14_set_b100w_bit_8.c @@ -0,0 +1,19 @@ +/* { 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__)) = 0x1234; +unsigned short *p = &B100; + +void +Do (void) +{ + B100 |= 0x0100; +} + +int +main (void) +{ + Do (); + return (*p == 0x1334) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/14_set_b100w_bit_f.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/14_set_b100w_bit_f.c new file mode 100644 index 00000000000..1fce8df53b3 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/14_set_b100w_bit_f.c @@ -0,0 +1,19 @@ +/* { 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__)) = 0x1234; +unsigned short *p = &B100; + +void +Do (void) +{ + B100 |= 0x8000; +} + +int +main (void) +{ + Do (); + return (*p == 0x9234) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/15_clr_b100w_bit_0.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/15_clr_b100w_bit_0.c new file mode 100644 index 00000000000..7c1c9b3e74d --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/15_clr_b100w_bit_0.c @@ -0,0 +1,19 @@ +/* { 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__)) = 0xedcb; +unsigned short *p = &B100; + +void +Do (void) +{ + B100 &= ~0x0001; +} + +int +main (void) +{ + Do (); + return (*p == 0xedca) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/15_clr_b100w_bit_7.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/15_clr_b100w_bit_7.c new file mode 100644 index 00000000000..fd707dc789d --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/15_clr_b100w_bit_7.c @@ -0,0 +1,19 @@ +/* { 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__)) = 0xedcb; +unsigned short *p = &B100; + +void +Do (void) +{ + B100 &= ~0x0080; +} + +int +main (void) +{ + Do (); + return (*p == 0xed4b) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/15_clr_b100w_bit_8.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/15_clr_b100w_bit_8.c new file mode 100644 index 00000000000..7788de60bd9 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/15_clr_b100w_bit_8.c @@ -0,0 +1,19 @@ +/* { 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__)) = 0xedcb; +unsigned short *p = &B100; + +void +Do (void) +{ + B100 &= ~0x0100; +} + +int +main (void) +{ + Do (); + return (*p == 0xeccb) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/15_clr_b100w_bit_f.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/15_clr_b100w_bit_f.c new file mode 100644 index 00000000000..8046ee3708a --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/15_clr_b100w_bit_f.c @@ -0,0 +1,19 @@ +/* { 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__)) = 0xedcb; +unsigned short *p = &B100; + +void +Do (void) +{ + B100 &= ~0x8000; +} + +int +main (void) +{ + Do (); + return (*p == 0x6dcb) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/16_if1_b100w_bit_0.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/16_if1_b100w_bit_0.c new file mode 100644 index 00000000000..a5df453aef4 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/16_if1_b100w_bit_0.c @@ -0,0 +1,29 @@ +/* { 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__)) = 0xedcb; +unsigned short *pA = &B100A; +unsigned short B100B __attribute__ ((__BELOW100__)) = 0x1234; +unsigned short *pB = &B100B; + +char * +Do (void) +{ + if (B100A & 0x0001) + { + if (B100B & 0x0001) + return "Fail"; + else + return "Success"; + } + else + return "Fail"; +} + +int +main (void) +{ + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/16_if1_b100w_bit_3.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/16_if1_b100w_bit_3.c new file mode 100644 index 00000000000..8ff76e19d1b --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/16_if1_b100w_bit_3.c @@ -0,0 +1,29 @@ +/* { 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__)) = 0xedcb; +unsigned short *pA = &B100A; +unsigned short B100B __attribute__ ((__BELOW100__)) = 0x1234; +unsigned short *pB = &B100B; + +char * +Do (void) +{ + if (B100A & 0x0008) + { + if (B100B & 0x0008) + return "Fail"; + else + return "Success"; + } + else + return "Fail"; +} + +int +main (void) +{ + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/16_if1_b100w_bit_7.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/16_if1_b100w_bit_7.c new file mode 100644 index 00000000000..8f542f31aa8 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/16_if1_b100w_bit_7.c @@ -0,0 +1,29 @@ +/* { 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__)) = 0xedcb; +unsigned short *pA = &B100A; +unsigned short B100B __attribute__ ((__BELOW100__)) = 0x1234; +unsigned short *pB = &B100B; + +char * +Do (void) +{ + if (B100A & 0x0080) + { + if (B100B & 0x0080) + return "Fail"; + else + return "Success"; + } + else + return "Fail"; +} + +int +main (void) +{ + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/16_if1_b100w_bit_8.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/16_if1_b100w_bit_8.c new file mode 100644 index 00000000000..727104cb251 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/16_if1_b100w_bit_8.c @@ -0,0 +1,29 @@ +/* { 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__)) = 0xedcb; +unsigned short *pA = &B100A; +unsigned short B100B __attribute__ ((__BELOW100__)) = 0x1234; +unsigned short *pB = &B100B; + +char * +Do (void) +{ + if (B100A & 0x0100) + { + if (B100B & 0x0100) + return "Fail"; + else + return "Success"; + } + else + return "Fail"; +} + +int +main (void) +{ + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/16_if1_b100w_bit_b.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/16_if1_b100w_bit_b.c new file mode 100644 index 00000000000..74fd6696172 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/16_if1_b100w_bit_b.c @@ -0,0 +1,29 @@ +/* { 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__)) = 0xedcb; +unsigned short *pA = &B100A; +unsigned short B100B __attribute__ ((__BELOW100__)) = 0x1234; +unsigned short *pB = &B100B; + +char * +Do (void) +{ + if (B100A & 0x0800) + { + if (B100B & 0x0800) + return "Fail"; + else + return "Success"; + } + else + return "Fail"; +} + +int +main (void) +{ + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/16_if1_b100w_bit_f.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/16_if1_b100w_bit_f.c new file mode 100644 index 00000000000..79b3839d898 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/16_if1_b100w_bit_f.c @@ -0,0 +1,29 @@ +/* { 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__)) = 0xedcb; +unsigned short *pA = &B100A; +unsigned short B100B __attribute__ ((__BELOW100__)) = 0x1234; +unsigned short *pB = &B100B; + +char * +Do (void) +{ + if (B100A & 0x8000) + { + if (B100B & 0x8000) + return "Fail"; + else + return "Success"; + } + else + return "Fail"; +} + +int +main (void) +{ + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/17_if0_b100w_bit_0.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/17_if0_b100w_bit_0.c new file mode 100644 index 00000000000..94dc08884c9 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/17_if0_b100w_bit_0.c @@ -0,0 +1,29 @@ +/* { 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__)) = 0x1234; +unsigned short *pA = &B100A; +unsigned short B100B __attribute__ ((__BELOW100__)) = 0xedcb; +unsigned short *pB = &B100B; + +char * +Do (void) +{ + if (!(B100A & 0x0001)) + { + if (!(B100B & 0x0001)) + return "Fail"; + else + return "Success"; + } + else + return "Fail"; +} + +int +main (void) +{ + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/17_if0_b100w_bit_3.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/17_if0_b100w_bit_3.c new file mode 100644 index 00000000000..7bc005dbad4 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/17_if0_b100w_bit_3.c @@ -0,0 +1,29 @@ +/* { 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__)) = 0x1234; +unsigned short *pA = &B100A; +unsigned short B100B __attribute__ ((__BELOW100__)) = 0xedcb; +unsigned short *pB = &B100B; + +char * +Do (void) +{ + if (!(B100A & 0x0008)) + { + if (!(B100B & 0x0008)) + return "Fail"; + else + return "Success"; + } + else + return "Fail"; +} + +int +main (void) +{ + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/17_if0_b100w_bit_7.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/17_if0_b100w_bit_7.c new file mode 100644 index 00000000000..64fcdc251cb --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/17_if0_b100w_bit_7.c @@ -0,0 +1,29 @@ +/* { 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__)) = 0x1234; +unsigned short *pA = &B100A; +unsigned short B100B __attribute__ ((__BELOW100__)) = 0xedcb; +unsigned short *pB = &B100B; + +char * +Do (void) +{ + if (!(B100A & 0x0080)) + { + if (!(B100B & 0x0080)) + return "Fail"; + else + return "Success"; + } + else + return "Fail"; +} + +int +main (void) +{ + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/17_if0_b100w_bit_8.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/17_if0_b100w_bit_8.c new file mode 100644 index 00000000000..6a118126e81 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/17_if0_b100w_bit_8.c @@ -0,0 +1,29 @@ +/* { 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__)) = 0x1234; +unsigned short *pA = &B100A; +unsigned short B100B __attribute__ ((__BELOW100__)) = 0xedcb; +unsigned short *pB = &B100B; + +char * +Do (void) +{ + if (!(B100A & 0x0100)) + { + if (!(B100B & 0x0100)) + return "Fail"; + else + return "Success"; + } + else + return "Fail"; +} + +int +main (void) +{ + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/17_if0_b100w_bit_b.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/17_if0_b100w_bit_b.c new file mode 100644 index 00000000000..59a2f3578ff --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/17_if0_b100w_bit_b.c @@ -0,0 +1,29 @@ +/* { 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__)) = 0x1234; +unsigned short *pA = &B100A; +unsigned short B100B __attribute__ ((__BELOW100__)) = 0xedcb; +unsigned short *pB = &B100B; + +char * +Do (void) +{ + if (!(B100A & 0x0800)) + { + if (!(B100B & 0x0800)) + return "Fail"; + else + return "Success"; + } + else + return "Fail"; +} + +int +main (void) +{ + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/17_if0_b100w_bit_f.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/17_if0_b100w_bit_f.c new file mode 100644 index 00000000000..3b271902bf9 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/17_if0_b100w_bit_f.c @@ -0,0 +1,29 @@ +/* { 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__)) = 0x1234; +unsigned short *pA = &B100A; +unsigned short B100B __attribute__ ((__BELOW100__)) = 0xedcb; +unsigned short *pB = &B100B; + +char * +Do (void) +{ + if (!(B100A & 0x8000)) + { + if (!(B100B & 0x8000)) + return "Fail"; + else + return "Success"; + } + else + return "Fail"; +} + +int +main (void) +{ + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/20_set_b100b_bitfield_0.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/20_set_b100b_bitfield_0.c new file mode 100644 index 00000000000..fef1f2ed45d --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/20_set_b100b_bitfield_0.c @@ -0,0 +1,33 @@ +/* { 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__)) = +{ +0, 0, 1, 0, 1, 1, 0, 0}; +unsigned char *p = (unsigned char *) &B100; + +void +Do (void) +{ + B100.b0 = 1; +} + +int +main (void) +{ + Do (); + return (*p == 0x35) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/20_set_b100b_bitfield_7.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/20_set_b100b_bitfield_7.c new file mode 100644 index 00000000000..b3900ca82ff --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/20_set_b100b_bitfield_7.c @@ -0,0 +1,33 @@ +/* { 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__)) = +{ +0, 0, 1, 0, 1, 1, 0, 0}; +unsigned char *p = (unsigned char *) &B100; + +void +Do (void) +{ + B100.b7 = 1; +} + +int +main (void) +{ + Do (); + return (*p == 0xb4) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/21_clr_b100b_bitfield_0.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/21_clr_b100b_bitfield_0.c new file mode 100644 index 00000000000..6106f386058 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/21_clr_b100b_bitfield_0.c @@ -0,0 +1,33 @@ +/* { 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__)) = +{ +1, 1, 0, 1, 0, 0, 1, 1}; +unsigned char *p = (unsigned char *) &B100; + +void +Do (void) +{ + B100.b0 = 0; +} + +int +main (void) +{ + Do (); + return (*p == 0xca) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/21_clr_b100b_bitfield_7.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/21_clr_b100b_bitfield_7.c new file mode 100644 index 00000000000..414eec653f4 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/21_clr_b100b_bitfield_7.c @@ -0,0 +1,33 @@ +/* { 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__)) = +{ +1, 1, 0, 1, 0, 0, 1, 1}; +unsigned char *p = (unsigned char *) &B100; + +void +Do (void) +{ + B100.b7 = 0; +} + +int +main (void) +{ + Do (); + return (*p == 0x4b) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/22_if1_b100b_bitfield_0.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/22_if1_b100b_bitfield_0.c new file mode 100644 index 00000000000..b950c518418 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/22_if1_b100b_bitfield_0.c @@ -0,0 +1,45 @@ +/* { 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__)) = +{ +1, 1, 0, 1, 0, 0, 1, 1}; +unsigned char *pA = (unsigned char *) &B100A; +BitField B100B __attribute__ ((__BELOW100__)) = +{ +0, 0, 1, 0, 1, 1, 0, 0}; +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) +{ + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/22_if1_b100b_bitfield_3.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/22_if1_b100b_bitfield_3.c new file mode 100644 index 00000000000..b9da6a5e652 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/22_if1_b100b_bitfield_3.c @@ -0,0 +1,45 @@ +/* { 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__)) = +{ +1, 1, 0, 1, 0, 0, 1, 1}; +unsigned char *pA = (unsigned char *) &B100A; +BitField B100B __attribute__ ((__BELOW100__)) = +{ +0, 0, 1, 0, 1, 1, 0, 0}; +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) +{ + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/22_if1_b100b_bitfield_7.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/22_if1_b100b_bitfield_7.c new file mode 100644 index 00000000000..667e892ea55 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/22_if1_b100b_bitfield_7.c @@ -0,0 +1,45 @@ +/* { 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__)) = +{ +1, 1, 0, 1, 0, 0, 1, 1}; +unsigned char *pA = (unsigned char *) &B100A; +BitField B100B __attribute__ ((__BELOW100__)) = +{ +0, 0, 1, 0, 1, 1, 0, 0}; +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) +{ + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/23_if0_b100b_bitfield_0.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/23_if0_b100b_bitfield_0.c new file mode 100644 index 00000000000..ebb63f74c9e --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/23_if0_b100b_bitfield_0.c @@ -0,0 +1,45 @@ +/* { 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__)) = +{ +0, 0, 1, 0, 1, 1, 0, 0}; +unsigned char *pA = (unsigned char *) &B100A; +BitField B100B __attribute__ ((__BELOW100__)) = +{ +1, 1, 0, 1, 0, 0, 1, 1}; +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) +{ + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/23_if0_b100b_bitfield_3.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/23_if0_b100b_bitfield_3.c new file mode 100644 index 00000000000..a16768e40cc --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/23_if0_b100b_bitfield_3.c @@ -0,0 +1,45 @@ +/* { 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__)) = +{ +0, 0, 1, 0, 1, 1, 0, 0}; +unsigned char *pA = (unsigned char *) &B100A; +BitField B100B __attribute__ ((__BELOW100__)) = +{ +1, 1, 0, 1, 0, 0, 1, 1}; +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) +{ + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/23_if0_b100b_bitfield_7.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/23_if0_b100b_bitfield_7.c new file mode 100644 index 00000000000..6f6d181e571 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/23_if0_b100b_bitfield_7.c @@ -0,0 +1,45 @@ +/* { 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__)) = +{ +0, 0, 1, 0, 1, 1, 0, 0}; +unsigned char *pA = (unsigned char *) &B100A; +BitField B100B __attribute__ ((__BELOW100__)) = +{ +1, 1, 0, 1, 0, 0, 1, 1}; +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) +{ + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/24_set_b100w_bitfield_0.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/24_set_b100w_bitfield_0.c new file mode 100644 index 00000000000..7ac5028af94 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/24_set_b100w_bitfield_0.c @@ -0,0 +1,41 @@ +/* { 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__)) = +{ +0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0}; +unsigned short *p = (unsigned short *) &B100; + +void +Do (void) +{ + B100.b0 = 1; +} + +int +main (void) +{ + Do (); + return (*p == 0x1235) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/24_set_b100w_bitfield_7.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/24_set_b100w_bitfield_7.c new file mode 100644 index 00000000000..8ba664bedaf --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/24_set_b100w_bitfield_7.c @@ -0,0 +1,41 @@ +/* { 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__)) = +{ +0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0}; +unsigned short *p = (unsigned short *) &B100; + +void +Do (void) +{ + B100.b7 = 1; +} + +int +main (void) +{ + Do (); + return (*p == 0x12b4) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/24_set_b100w_bitfield_8.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/24_set_b100w_bitfield_8.c new file mode 100644 index 00000000000..2a43500c188 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/24_set_b100w_bitfield_8.c @@ -0,0 +1,41 @@ +/* { 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__)) = +{ +0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0}; +unsigned short *p = (unsigned short *) &B100; + +void +Do (void) +{ + B100.b8 = 1; +} + +int +main (void) +{ + Do (); + return (*p == 0x1334) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/24_set_b100w_bitfield_f.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/24_set_b100w_bitfield_f.c new file mode 100644 index 00000000000..9ae5ce48b25 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/24_set_b100w_bitfield_f.c @@ -0,0 +1,41 @@ +/* { 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__)) = +{ +0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0}; +unsigned short *p = (unsigned short *) &B100; + +void +Do (void) +{ + B100.b15 = 1; +} + +int +main (void) +{ + Do (); + return (*p == 0x9234) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/25_clr_b100w_bitfield_0.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/25_clr_b100w_bitfield_0.c new file mode 100644 index 00000000000..94fdf696995 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/25_clr_b100w_bitfield_0.c @@ -0,0 +1,41 @@ +/* { 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__)) = +{ +1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1}; +unsigned short *p = (unsigned short *) &B100; + +void +Do (void) +{ + B100.b0 = 0; +} + +int +main (void) +{ + Do (); + return (*p == 0xedca) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/25_clr_b100w_bitfield_7.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/25_clr_b100w_bitfield_7.c new file mode 100644 index 00000000000..25f11a603c6 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/25_clr_b100w_bitfield_7.c @@ -0,0 +1,41 @@ +/* { 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__)) = +{ +1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1}; +unsigned short *p = (unsigned short *) &B100; + +void +Do (void) +{ + B100.b7 = 0; +} + +int +main (void) +{ + Do (); + return (*p == 0xed4b) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/25_clr_b100w_bitfield_8.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/25_clr_b100w_bitfield_8.c new file mode 100644 index 00000000000..d065be14659 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/25_clr_b100w_bitfield_8.c @@ -0,0 +1,41 @@ +/* { 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__)) = +{ +1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1}; +unsigned short *p = (unsigned short *) &B100; + +void +Do (void) +{ + B100.b8 = 0; +} + +int +main (void) +{ + Do (); + return (*p == 0xeccb) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/25_clr_b100w_bitfield_f.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/25_clr_b100w_bitfield_f.c new file mode 100644 index 00000000000..4fbe7145555 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/25_clr_b100w_bitfield_f.c @@ -0,0 +1,41 @@ +/* { 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__)) = +{ +1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1}; +unsigned short *p = (unsigned short *) &B100; + +void +Do (void) +{ + B100.b15 = 0; +} + +int +main (void) +{ + Do (); + return (*p == 0x6dcb) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/26_if1_b100w_bitfield_0.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/26_if1_b100w_bitfield_0.c new file mode 100644 index 00000000000..054c0f51e01 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/26_if1_b100w_bitfield_0.c @@ -0,0 +1,53 @@ +/* { 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__)) = +{ +1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1}; +unsigned short *pA = (unsigned short *) &B100A; +BitField B100B __attribute__ ((__BELOW100__)) = +{ +0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0}; +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) +{ + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/26_if1_b100w_bitfield_3.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/26_if1_b100w_bitfield_3.c new file mode 100644 index 00000000000..75ef36b3469 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/26_if1_b100w_bitfield_3.c @@ -0,0 +1,53 @@ +/* { 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__)) = +{ +1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1}; +unsigned short *pA = (unsigned short *) &B100A; +BitField B100B __attribute__ ((__BELOW100__)) = +{ +0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0}; +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) +{ + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/26_if1_b100w_bitfield_7.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/26_if1_b100w_bitfield_7.c new file mode 100644 index 00000000000..45df6371c09 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/26_if1_b100w_bitfield_7.c @@ -0,0 +1,53 @@ +/* { 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__)) = +{ +1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1}; +unsigned short *pA = (unsigned short *) &B100A; +BitField B100B __attribute__ ((__BELOW100__)) = +{ +0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0}; +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) +{ + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/26_if1_b100w_bitfield_8.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/26_if1_b100w_bitfield_8.c new file mode 100644 index 00000000000..187a4776168 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/26_if1_b100w_bitfield_8.c @@ -0,0 +1,53 @@ +/* { 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__)) = +{ +1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1}; +unsigned short *pA = (unsigned short *) &B100A; +BitField B100B __attribute__ ((__BELOW100__)) = +{ +0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0}; +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) +{ + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/26_if1_b100w_bitfield_b.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/26_if1_b100w_bitfield_b.c new file mode 100644 index 00000000000..8cf4cfd53a4 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/26_if1_b100w_bitfield_b.c @@ -0,0 +1,53 @@ +/* { 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__)) = +{ +1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1}; +unsigned short *pA = (unsigned short *) &B100A; +BitField B100B __attribute__ ((__BELOW100__)) = +{ +0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0}; +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) +{ + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/26_if1_b100w_bitfield_f.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/26_if1_b100w_bitfield_f.c new file mode 100644 index 00000000000..235cef7d250 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/26_if1_b100w_bitfield_f.c @@ -0,0 +1,53 @@ +/* { 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__)) = +{ +1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1}; +unsigned short *pA = (unsigned short *) &B100A; +BitField B100B __attribute__ ((__BELOW100__)) = +{ +0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0}; +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) +{ + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/27_if0_b100w_bitfield_0.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/27_if0_b100w_bitfield_0.c new file mode 100644 index 00000000000..bb80aca8158 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/27_if0_b100w_bitfield_0.c @@ -0,0 +1,53 @@ +/* { 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__)) = +{ +0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0}; +unsigned short *pA = (unsigned short *) &B100A; +BitField B100B __attribute__ ((__BELOW100__)) = +{ +1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1}; +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) +{ + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/27_if0_b100w_bitfield_3.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/27_if0_b100w_bitfield_3.c new file mode 100644 index 00000000000..5be55642680 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/27_if0_b100w_bitfield_3.c @@ -0,0 +1,53 @@ +/* { 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__)) = +{ +0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0}; +unsigned short *pA = (unsigned short *) &B100A; +BitField B100B __attribute__ ((__BELOW100__)) = +{ +1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1}; +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) +{ + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/27_if0_b100w_bitfield_7.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/27_if0_b100w_bitfield_7.c new file mode 100644 index 00000000000..0725b554219 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/27_if0_b100w_bitfield_7.c @@ -0,0 +1,53 @@ +/* { 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__)) = +{ +0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0}; +unsigned short *pA = (unsigned short *) &B100A; +BitField B100B __attribute__ ((__BELOW100__)) = +{ +1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1}; +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) +{ + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/27_if0_b100w_bitfield_8.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/27_if0_b100w_bitfield_8.c new file mode 100644 index 00000000000..2ad3642f845 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/27_if0_b100w_bitfield_8.c @@ -0,0 +1,53 @@ +/* { 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__)) = +{ +0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0}; +unsigned short *pA = (unsigned short *) &B100A; +BitField B100B __attribute__ ((__BELOW100__)) = +{ +1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1}; +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) +{ + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/27_if0_b100w_bitfield_b.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/27_if0_b100w_bitfield_b.c new file mode 100644 index 00000000000..e9af02f8e4d --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/27_if0_b100w_bitfield_b.c @@ -0,0 +1,53 @@ +/* { 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__)) = +{ +0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0}; +unsigned short *pA = (unsigned short *) &B100A; +BitField B100B __attribute__ ((__BELOW100__)) = +{ +1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1}; +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) +{ + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/data_below100/27_if0_b100w_bitfield_f.c b/gcc/testsuite/gcc.target/xstormy16/data_below100/27_if0_b100w_bitfield_f.c new file mode 100644 index 00000000000..a13ec8c2cd4 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/data_below100/27_if0_b100w_bitfield_f.c @@ -0,0 +1,53 @@ +/* { 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__)) = +{ +0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0}; +unsigned short *pA = (unsigned short *) &B100A; +BitField B100B __attribute__ ((__BELOW100__)) = +{ +1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1}; +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) +{ + return Do ()[0] == 'F'; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/sfr/01_const_to_sfrb.c b/gcc/testsuite/gcc.target/xstormy16/sfr/01_const_to_sfrb.c new file mode 100644 index 00000000000..96e4adcfb63 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/01_const_to_sfrb.c @@ -0,0 +1,19 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "mov.b 32532,#18" } } */ + +#define SFR (*((volatile unsigned char*)0x7f14)) +unsigned char *p = (unsigned char *) 0x7f14; + +void +Do (void) +{ + SFR = 0x12; +} + +int +main (void) +{ + *p = 0x34; + Do (); + return (*p == 0x12) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/sfr/02_const_to_sfrw.c b/gcc/testsuite/gcc.target/xstormy16/sfr/02_const_to_sfrw.c new file mode 100644 index 00000000000..930ba4d967c --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/02_const_to_sfrw.c @@ -0,0 +1,19 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "mov.w 32532,#4660" } } */ + +#define SFR (*((volatile unsigned short*)0x7f14)) +unsigned short *p = (unsigned short *) 0x7f14; + +void +Do (void) +{ + SFR = 0x1234; +} + +int +main (void) +{ + *p = 0x9876; + Do (); + return (*p == 0x1234) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/sfr/03_var_to_sfrb.c b/gcc/testsuite/gcc.target/xstormy16/sfr/03_var_to_sfrb.c new file mode 100644 index 00000000000..8c4b1f1c735 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/03_var_to_sfrb.c @@ -0,0 +1,21 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "mov.b 32532,r" } } */ + +#define SFR (*((volatile unsigned char*)0x7f14)) +unsigned char *p = (unsigned char *) 0x7f14; + +unsigned char yData = 0x12; + +void +Do (void) +{ + SFR = yData; +} + +int +main (void) +{ + *p = 0x34; + Do (); + return (*p == 0x12) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/sfr/04_var_to_sfrw.c b/gcc/testsuite/gcc.target/xstormy16/sfr/04_var_to_sfrw.c new file mode 100644 index 00000000000..c8d4a0e6660 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/04_var_to_sfrw.c @@ -0,0 +1,21 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "mov.w 32532,r" } } */ + +#define SFR (*((volatile unsigned short*)0x7f14)) +unsigned short *p = (unsigned short *) 0x7f14; + +unsigned short wData = 0x1234; + +void +Do (void) +{ + SFR = wData; +} + +int +main (void) +{ + *p = 0x9876; + Do (); + return (*p == 0x1234) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/sfr/05_sfrb_to_var.c b/gcc/testsuite/gcc.target/xstormy16/sfr/05_sfrb_to_var.c new file mode 100644 index 00000000000..9471e295a7f --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/05_sfrb_to_var.c @@ -0,0 +1,21 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "mov.b r., *32532" } } */ + +#define SFR (*((volatile unsigned char*)0x7f14)) +unsigned char *p = (unsigned char *) 0x7f14; + +unsigned char yData = 0x12; + +void +Do (void) +{ + yData = SFR; +} + +int +main (void) +{ + *p = 0x34; + Do (); + return (yData == 0x34) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/sfr/06_sfrw_to_var.c b/gcc/testsuite/gcc.target/xstormy16/sfr/06_sfrw_to_var.c new file mode 100644 index 00000000000..39cbab5c3e9 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/06_sfrw_to_var.c @@ -0,0 +1,21 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "mov.w r6,32532" } } */ + +#define SFR (*((volatile unsigned short*)0x7f14)) +unsigned short *p = (unsigned short *) 0x7f14; + +unsigned short wData = 0x9876; + +void +Do (void) +{ + wData = SFR; +} + +int +main (void) +{ + *p = 0x1234; + Do (); + return (wData == 0x1234) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/sfr/10_set_sfrb_bit_0.c b/gcc/testsuite/gcc.target/xstormy16/sfr/10_set_sfrb_bit_0.c new file mode 100644 index 00000000000..644afb59c0d --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/10_set_sfrb_bit_0.c @@ -0,0 +1,19 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "set1 32532,#0" } } */ + +#define SFR (*((volatile unsigned char*)0x7f14)) +unsigned char *p = (unsigned char *) 0x7f14; + +void +Do (void) +{ + SFR |= 0x01; +} + +int +main (void) +{ + *p = 0x34; + Do (); + return (*p == 0x35) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/sfr/10_set_sfrb_bit_7.c b/gcc/testsuite/gcc.target/xstormy16/sfr/10_set_sfrb_bit_7.c new file mode 100644 index 00000000000..90cd3c83f8a --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/10_set_sfrb_bit_7.c @@ -0,0 +1,19 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "set1 32532,#7" } } */ + +#define SFR (*((volatile unsigned char*)0x7f14)) +unsigned char *p = (unsigned char *) 0x7f14; + +void +Do (void) +{ + SFR |= 0x80; +} + +int +main (void) +{ + *p = 0x34; + Do (); + return (*p == 0xb4) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/sfr/11_clr_sfrb_bit_0.c b/gcc/testsuite/gcc.target/xstormy16/sfr/11_clr_sfrb_bit_0.c new file mode 100644 index 00000000000..59d6153edd6 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/11_clr_sfrb_bit_0.c @@ -0,0 +1,19 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "clr1 32532,#0" } } */ + +#define SFR (*((volatile unsigned char*)0x7f14)) +unsigned char *p = (unsigned char *) 0x7f14; + +void +Do (void) +{ + SFR &= ~0x01; +} + +int +main (void) +{ + *p = 0xcb; + Do (); + return (*p == 0xca) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/sfr/11_clr_sfrb_bit_7.c b/gcc/testsuite/gcc.target/xstormy16/sfr/11_clr_sfrb_bit_7.c new file mode 100644 index 00000000000..0cb7e1761c9 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/11_clr_sfrb_bit_7.c @@ -0,0 +1,19 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "clr1 32532,#7" } } */ + +#define SFR (*((volatile unsigned char*)0x7f14)) +unsigned char *p = (unsigned char *) 0x7f14; + +void +Do (void) +{ + SFR &= ~0x80; +} + +int +main (void) +{ + *p = 0xcb; + Do (); + return (*p == 0x4b) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/sfr/12_if1_sfrb_bit_0.c b/gcc/testsuite/gcc.target/xstormy16/sfr/12_if1_sfrb_bit_0.c new file mode 100644 index 00000000000..54b0b1f6dc2 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/12_if1_sfrb_bit_0.c @@ -0,0 +1,29 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "b\[np\] " } } */ + +#define SFRA (*((volatile unsigned char*)0x7f14)) +unsigned char *pA = (unsigned char *) 0x7f14; +#define SFRB (*((volatile unsigned char*)0x7f10)) +unsigned char *pB = (unsigned char *) 0x7f10; + +char * +Do (void) +{ + if (SFRA & 0x01) + { + if (SFRB & 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/sfr/12_if1_sfrb_bit_3.c b/gcc/testsuite/gcc.target/xstormy16/sfr/12_if1_sfrb_bit_3.c new file mode 100644 index 00000000000..4a575cc9905 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/12_if1_sfrb_bit_3.c @@ -0,0 +1,29 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "b\[np\] " } } */ + +#define SFRA (*((volatile unsigned char*)0x7f14)) +unsigned char *pA = (unsigned char *) 0x7f14; +#define SFRB (*((volatile unsigned char*)0x7f10)) +unsigned char *pB = (unsigned char *) 0x7f10; + +char * +Do (void) +{ + if (SFRA & 0x08) + { + if (SFRB & 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/sfr/12_if1_sfrb_bit_7.c b/gcc/testsuite/gcc.target/xstormy16/sfr/12_if1_sfrb_bit_7.c new file mode 100644 index 00000000000..747cbdd9487 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/12_if1_sfrb_bit_7.c @@ -0,0 +1,29 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "b\[np\] " } } */ + +#define SFRA (*((volatile unsigned char*)0x7f14)) +unsigned char *pA = (unsigned char *) 0x7f14; +#define SFRB (*((volatile unsigned char*)0x7f10)) +unsigned char *pB = (unsigned char *) 0x7f10; + +char * +Do (void) +{ + if (SFRA & 0x80) + { + if (SFRB & 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/sfr/13_if0_sfrb_bit_0.c b/gcc/testsuite/gcc.target/xstormy16/sfr/13_if0_sfrb_bit_0.c new file mode 100644 index 00000000000..d149692064c --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/13_if0_sfrb_bit_0.c @@ -0,0 +1,29 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "b\[np\] " } } */ + +#define SFRA (*((volatile unsigned char*)0x7f14)) +unsigned char *pA = (unsigned char *) 0x7f14; +#define SFRB (*((volatile unsigned char*)0x7f10)) +unsigned char *pB = (unsigned char *) 0x7f10; + +char * +Do (void) +{ + if (!(SFRA & 0x01)) + { + if (!(SFRB & 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/sfr/13_if0_sfrb_bit_3.c b/gcc/testsuite/gcc.target/xstormy16/sfr/13_if0_sfrb_bit_3.c new file mode 100644 index 00000000000..be6112cf119 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/13_if0_sfrb_bit_3.c @@ -0,0 +1,29 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "b\[np\] " } } */ + +#define SFRA (*((volatile unsigned char*)0x7f14)) +unsigned char *pA = (unsigned char *) 0x7f14; +#define SFRB (*((volatile unsigned char*)0x7f10)) +unsigned char *pB = (unsigned char *) 0x7f10; + +char * +Do (void) +{ + if (!(SFRA & 0x08)) + { + if (!(SFRB & 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/sfr/13_if0_sfrb_bit_7.c b/gcc/testsuite/gcc.target/xstormy16/sfr/13_if0_sfrb_bit_7.c new file mode 100644 index 00000000000..12e68cd5b27 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/13_if0_sfrb_bit_7.c @@ -0,0 +1,29 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "b\[np\] " } } */ + +#define SFRA (*((volatile unsigned char*)0x7f14)) +unsigned char *pA = (unsigned char *) 0x7f14; +#define SFRB (*((volatile unsigned char*)0x7f10)) +unsigned char *pB = (unsigned char *) 0x7f10; + +char * +Do (void) +{ + if (!(SFRA & 0x80)) + { + if (!(SFRB & 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/sfr/14_set_sfrw_bit_0.c b/gcc/testsuite/gcc.target/xstormy16/sfr/14_set_sfrw_bit_0.c new file mode 100644 index 00000000000..00f4f78cc95 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/14_set_sfrw_bit_0.c @@ -0,0 +1,19 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "mov.w r.,32532" } } */ + +#define SFR (*((volatile unsigned short*)0x7f14)) +unsigned short *p = (unsigned short *) 0x7f14; + +void +Do (void) +{ + SFR |= 0x0001; +} + +int +main (void) +{ + *p = 0x1234; + Do (); + return (*p == 0x1235) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/sfr/14_set_sfrw_bit_3.c b/gcc/testsuite/gcc.target/xstormy16/sfr/14_set_sfrw_bit_3.c new file mode 100644 index 00000000000..b5741fc485f --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/14_set_sfrw_bit_3.c @@ -0,0 +1,19 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "mov.w r.,32532" } } */ + +#define SFR (*((volatile unsigned short*)0x7f14)) +unsigned short *p = (unsigned short *) 0x7f14; + +void +Do (void) +{ + SFR |= 0x0008; +} + +int +main (void) +{ + *p = 0x1234; + Do (); + return (*p == 0x123c) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/sfr/14_set_sfrw_bit_7.c b/gcc/testsuite/gcc.target/xstormy16/sfr/14_set_sfrw_bit_7.c new file mode 100644 index 00000000000..ffcad45b2a7 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/14_set_sfrw_bit_7.c @@ -0,0 +1,19 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "mov.w r.,32532" } } */ + +#define SFR (*((volatile unsigned short*)0x7f14)) +unsigned short *p = (unsigned short *) 0x7f14; + +void +Do (void) +{ + SFR |= 0x0080; +} + +int +main (void) +{ + *p = 0x1234; + Do (); + return (*p == 0x12b4) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/sfr/14_set_sfrw_bit_8.c b/gcc/testsuite/gcc.target/xstormy16/sfr/14_set_sfrw_bit_8.c new file mode 100644 index 00000000000..3f19329f285 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/14_set_sfrw_bit_8.c @@ -0,0 +1,19 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "mov.w r.,32532" } } */ + +#define SFR (*((volatile unsigned short*)0x7f14)) +unsigned short *p = (unsigned short *) 0x7f14; + +void +Do (void) +{ + SFR |= 0x0100; +} + +int +main (void) +{ + *p = 0x1234; + Do (); + return (*p == 0x1334) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/sfr/14_set_sfrw_bit_b.c b/gcc/testsuite/gcc.target/xstormy16/sfr/14_set_sfrw_bit_b.c new file mode 100644 index 00000000000..b5e8bb9e270 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/14_set_sfrw_bit_b.c @@ -0,0 +1,19 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "mov.w r.,32532" } } */ + +#define SFR (*((volatile unsigned short*)0x7f14)) +unsigned short *p = (unsigned short *) 0x7f14; + +void +Do (void) +{ + SFR |= 0x0800; +} + +int +main (void) +{ + *p = 0x1234; + Do (); + return (*p == 0x1a34) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/sfr/14_set_sfrw_bit_f.c b/gcc/testsuite/gcc.target/xstormy16/sfr/14_set_sfrw_bit_f.c new file mode 100644 index 00000000000..767e95ff481 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/14_set_sfrw_bit_f.c @@ -0,0 +1,19 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "mov.w r.,32532" } } */ + +#define SFR (*((volatile unsigned short*)0x7f14)) +unsigned short *p = (unsigned short *) 0x7f14; + +void +Do (void) +{ + SFR |= 0x8000; +} + +int +main (void) +{ + *p = 0x1234; + Do (); + return (*p == 0x9234) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/sfr/15_clr_sfrw_bit_0.c b/gcc/testsuite/gcc.target/xstormy16/sfr/15_clr_sfrw_bit_0.c new file mode 100644 index 00000000000..fcabe09948e --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/15_clr_sfrw_bit_0.c @@ -0,0 +1,19 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "mov.w r.,32532" } } */ + +#define SFR (*((volatile unsigned short*)0x7f14)) +unsigned short *p = (unsigned short *) 0x7f14; + +void +Do (void) +{ + SFR &= ~0x0001; +} + +int +main (void) +{ + *p = 0xedcb; + Do (); + return (*p == 0xedca) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/sfr/15_clr_sfrw_bit_3.c b/gcc/testsuite/gcc.target/xstormy16/sfr/15_clr_sfrw_bit_3.c new file mode 100644 index 00000000000..26281be8761 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/15_clr_sfrw_bit_3.c @@ -0,0 +1,19 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "mov.w r.,32532" } } */ + +#define SFR (*((volatile unsigned short*)0x7f14)) +unsigned short *p = (unsigned short *) 0x7f14; + +void +Do (void) +{ + SFR &= ~0x0008; +} + +int +main (void) +{ + *p = 0xedcb; + Do (); + return (*p == 0xedc3) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/sfr/15_clr_sfrw_bit_7.c b/gcc/testsuite/gcc.target/xstormy16/sfr/15_clr_sfrw_bit_7.c new file mode 100644 index 00000000000..15ff063f42a --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/15_clr_sfrw_bit_7.c @@ -0,0 +1,19 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "mov.w r.,32532" } } */ + +#define SFR (*((volatile unsigned short*)0x7f14)) +unsigned short *p = (unsigned short *) 0x7f14; + +void +Do (void) +{ + SFR &= ~0x0080; +} + +int +main (void) +{ + *p = 0xedcb; + Do (); + return (*p == 0xed4b) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/sfr/15_clr_sfrw_bit_8.c b/gcc/testsuite/gcc.target/xstormy16/sfr/15_clr_sfrw_bit_8.c new file mode 100644 index 00000000000..c44817a7306 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/15_clr_sfrw_bit_8.c @@ -0,0 +1,19 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "mov.w r.,32532" } } */ + +#define SFR (*((volatile unsigned short*)0x7f14)) +unsigned short *p = (unsigned short *) 0x7f14; + +void +Do (void) +{ + SFR &= ~0x0100; +} + +int +main (void) +{ + *p = 0xedcb; + Do (); + return (*p == 0xeccb) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/sfr/15_clr_sfrw_bit_b.c b/gcc/testsuite/gcc.target/xstormy16/sfr/15_clr_sfrw_bit_b.c new file mode 100644 index 00000000000..9f1c3a5e7bd --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/15_clr_sfrw_bit_b.c @@ -0,0 +1,19 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "mov.w r.,32532" } } */ + +#define SFR (*((volatile unsigned short*)0x7f14)) +unsigned short *p = (unsigned short *) 0x7f14; + +void +Do (void) +{ + SFR &= ~0x0800; +} + +int +main (void) +{ + *p = 0xedcb; + Do (); + return (*p == 0xe5cb) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/sfr/15_clr_sfrw_bit_f.c b/gcc/testsuite/gcc.target/xstormy16/sfr/15_clr_sfrw_bit_f.c new file mode 100644 index 00000000000..46eef43c454 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/15_clr_sfrw_bit_f.c @@ -0,0 +1,19 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "mov.w r.,32532" } } */ + +#define SFR (*((volatile unsigned short*)0x7f14)) +unsigned short *p = (unsigned short *) 0x7f14; + +void +Do (void) +{ + SFR &= ~0x8000; +} + +int +main (void) +{ + *p = 0xedcb; + Do (); + return (*p == 0x6dcb) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/sfr/16_if1_sfrw_bit_0.c b/gcc/testsuite/gcc.target/xstormy16/sfr/16_if1_sfrw_bit_0.c new file mode 100644 index 00000000000..287dd7a832b --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/16_if1_sfrw_bit_0.c @@ -0,0 +1,29 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "mov.w r.,32532" } } */ + +#define SFRA (*((volatile unsigned short*)0x7f14)) +unsigned short *pA = (unsigned short *) 0x7f14; +#define SFRB (*((volatile unsigned short*)0x7f10)) +unsigned short *pB = (unsigned short *) 0x7f10; + +char * +Do (void) +{ + if (SFRA & 0x0001) + { + if (SFRB & 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/sfr/16_if1_sfrw_bit_3.c b/gcc/testsuite/gcc.target/xstormy16/sfr/16_if1_sfrw_bit_3.c new file mode 100644 index 00000000000..719fa58dfd9 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/16_if1_sfrw_bit_3.c @@ -0,0 +1,29 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "mov.w r.,32532" } } */ + +#define SFRA (*((volatile unsigned short*)0x7f14)) +unsigned short *pA = (unsigned short *) 0x7f14; +#define SFRB (*((volatile unsigned short*)0x7f10)) +unsigned short *pB = (unsigned short *) 0x7f10; + +char * +Do (void) +{ + if (SFRA & 0x0008) + { + if (SFRB & 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/sfr/16_if1_sfrw_bit_7.c b/gcc/testsuite/gcc.target/xstormy16/sfr/16_if1_sfrw_bit_7.c new file mode 100644 index 00000000000..1b361c5feee --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/16_if1_sfrw_bit_7.c @@ -0,0 +1,29 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "mov.w r.,32532" } } */ + +#define SFRA (*((volatile unsigned short*)0x7f14)) +unsigned short *pA = (unsigned short *) 0x7f14; +#define SFRB (*((volatile unsigned short*)0x7f10)) +unsigned short *pB = (unsigned short *) 0x7f10; + +char * +Do (void) +{ + if (SFRA & 0x0080) + { + if (SFRB & 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/sfr/16_if1_sfrw_bit_8.c b/gcc/testsuite/gcc.target/xstormy16/sfr/16_if1_sfrw_bit_8.c new file mode 100644 index 00000000000..c8a3ba7cb94 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/16_if1_sfrw_bit_8.c @@ -0,0 +1,29 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "mov.w r.,32532" } } */ + +#define SFRA (*((volatile unsigned short*)0x7f14)) +unsigned short *pA = (unsigned short *) 0x7f14; +#define SFRB (*((volatile unsigned short*)0x7f10)) +unsigned short *pB = (unsigned short *) 0x7f10; + +char * +Do (void) +{ + if (SFRA & 0x0100) + { + if (SFRB & 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/sfr/16_if1_sfrw_bit_b.c b/gcc/testsuite/gcc.target/xstormy16/sfr/16_if1_sfrw_bit_b.c new file mode 100644 index 00000000000..a0f5742c1a2 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/16_if1_sfrw_bit_b.c @@ -0,0 +1,29 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "mov.w r.,32532" } } */ + +#define SFRA (*((volatile unsigned short*)0x7f14)) +unsigned short *pA = (unsigned short *) 0x7f14; +#define SFRB (*((volatile unsigned short*)0x7f10)) +unsigned short *pB = (unsigned short *) 0x7f10; + +char * +Do (void) +{ + if (SFRA & 0x0800) + { + if (SFRB & 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/sfr/16_if1_sfrw_bit_f.c b/gcc/testsuite/gcc.target/xstormy16/sfr/16_if1_sfrw_bit_f.c new file mode 100644 index 00000000000..5e91bb23e6b --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/16_if1_sfrw_bit_f.c @@ -0,0 +1,29 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "mov.w r.,32532" } } */ + +#define SFRA (*((volatile unsigned short*)0x7f14)) +unsigned short *pA = (unsigned short *) 0x7f14; +#define SFRB (*((volatile unsigned short*)0x7f10)) +unsigned short *pB = (unsigned short *) 0x7f10; + +char * +Do (void) +{ + if (SFRA & 0x8000) + { + if (SFRB & 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/sfr/17_if0_sfrw_bit_0.c b/gcc/testsuite/gcc.target/xstormy16/sfr/17_if0_sfrw_bit_0.c new file mode 100644 index 00000000000..ac5d87fe31d --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/17_if0_sfrw_bit_0.c @@ -0,0 +1,29 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "mov.w r.,32532" } } */ + +#define SFRA (*((volatile unsigned short*)0x7f14)) +unsigned short *pA = (unsigned short *) 0x7f14; +#define SFRB (*((volatile unsigned short*)0x7f10)) +unsigned short *pB = (unsigned short *) 0x7f10; + +char * +Do (void) +{ + if (!(SFRA & 0x0001)) + { + if (!(SFRB & 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/sfr/17_if0_sfrw_bit_3.c b/gcc/testsuite/gcc.target/xstormy16/sfr/17_if0_sfrw_bit_3.c new file mode 100644 index 00000000000..fa77f1bd1e6 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/17_if0_sfrw_bit_3.c @@ -0,0 +1,29 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "mov.w r.,32532" } } */ + +#define SFRA (*((volatile unsigned short*)0x7f14)) +unsigned short *pA = (unsigned short *) 0x7f14; +#define SFRB (*((volatile unsigned short*)0x7f10)) +unsigned short *pB = (unsigned short *) 0x7f10; + +char * +Do (void) +{ + if (!(SFRA & 0x0008)) + { + if (!(SFRB & 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/sfr/17_if0_sfrw_bit_7.c b/gcc/testsuite/gcc.target/xstormy16/sfr/17_if0_sfrw_bit_7.c new file mode 100644 index 00000000000..cb331f03435 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/17_if0_sfrw_bit_7.c @@ -0,0 +1,29 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "mov.w r.,32532" } } */ + +#define SFRA (*((volatile unsigned short*)0x7f14)) +unsigned short *pA = (unsigned short *) 0x7f14; +#define SFRB (*((volatile unsigned short*)0x7f10)) +unsigned short *pB = (unsigned short *) 0x7f10; + +char * +Do (void) +{ + if (!(SFRA & 0x0080)) + { + if (!(SFRB & 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/sfr/17_if0_sfrw_bit_8.c b/gcc/testsuite/gcc.target/xstormy16/sfr/17_if0_sfrw_bit_8.c new file mode 100644 index 00000000000..105bf4d8d8f --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/17_if0_sfrw_bit_8.c @@ -0,0 +1,29 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "mov.w r.,32532" } } */ + +#define SFRA (*((volatile unsigned short*)0x7f14)) +unsigned short *pA = (unsigned short *) 0x7f14; +#define SFRB (*((volatile unsigned short*)0x7f10)) +unsigned short *pB = (unsigned short *) 0x7f10; + +char * +Do (void) +{ + if (!(SFRA & 0x0100)) + { + if (!(SFRB & 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/sfr/17_if0_sfrw_bit_b.c b/gcc/testsuite/gcc.target/xstormy16/sfr/17_if0_sfrw_bit_b.c new file mode 100644 index 00000000000..768cfb92b89 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/17_if0_sfrw_bit_b.c @@ -0,0 +1,29 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "mov.w r.,32532" } } */ + +#define SFRA (*((volatile unsigned short*)0x7f14)) +unsigned short *pA = (unsigned short *) 0x7f14; +#define SFRB (*((volatile unsigned short*)0x7f10)) +unsigned short *pB = (unsigned short *) 0x7f10; + +char * +Do (void) +{ + if (!(SFRA & 0x0800)) + { + if (!(SFRB & 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/sfr/17_if0_sfrw_bit_f.c b/gcc/testsuite/gcc.target/xstormy16/sfr/17_if0_sfrw_bit_f.c new file mode 100644 index 00000000000..533a3c61ace --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/17_if0_sfrw_bit_f.c @@ -0,0 +1,29 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "mov.w r.,32532" } } */ + +#define SFRA (*((volatile unsigned short*)0x7f14)) +unsigned short *pA = (unsigned short *) 0x7f14; +#define SFRB (*((volatile unsigned short*)0x7f10)) +unsigned short *pB = (unsigned short *) 0x7f10; + +char * +Do (void) +{ + if (!(SFRA & 0x8000)) + { + if (!(SFRB & 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/sfr/20_set_sfrb_bitfield_0.c b/gcc/testsuite/gcc.target/xstormy16/sfr/20_set_sfrb_bitfield_0.c new file mode 100644 index 00000000000..3879ed43889 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/20_set_sfrb_bitfield_0.c @@ -0,0 +1,31 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "set1 32532,#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; + +#define SFR (*((volatile BitField*)0x7f14)) +unsigned char *p = (unsigned char *) 0x7f14; + +void +Do (void) +{ + SFR.b0 = 1; +} + +int +main (void) +{ + *p = 0x34; + Do (); + return (*p == 0x35) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/sfr/20_set_sfrb_bitfield_7.c b/gcc/testsuite/gcc.target/xstormy16/sfr/20_set_sfrb_bitfield_7.c new file mode 100644 index 00000000000..1b7bb877769 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/20_set_sfrb_bitfield_7.c @@ -0,0 +1,31 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "set1 32532,#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; + +#define SFR (*((volatile BitField*)0x7f14)) +unsigned char *p = (unsigned char *) 0x7f14; + +void +Do (void) +{ + SFR.b7 = 1; +} + +int +main (void) +{ + *p = 0x34; + Do (); + return (*p == 0xb4) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/sfr/21_clr_sfrb_bitfield_0.c b/gcc/testsuite/gcc.target/xstormy16/sfr/21_clr_sfrb_bitfield_0.c new file mode 100644 index 00000000000..6f73231c7bc --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/21_clr_sfrb_bitfield_0.c @@ -0,0 +1,31 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "clr1 32532,#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; + +#define SFR (*((volatile BitField*)0x7f14)) +unsigned char *p = (unsigned char *) 0x7f14; + +void +Do (void) +{ + SFR.b0 = 0; +} + +int +main (void) +{ + *p = 0xcb; + Do (); + return (*p == 0xca) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/sfr/21_clr_sfrb_bitfield_7.c b/gcc/testsuite/gcc.target/xstormy16/sfr/21_clr_sfrb_bitfield_7.c new file mode 100644 index 00000000000..10063e49286 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/21_clr_sfrb_bitfield_7.c @@ -0,0 +1,31 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "clr1 32532,#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; + +#define SFR (*((volatile BitField*)0x7f14)) +unsigned char *p = (unsigned char *) 0x7f14; + +void +Do (void) +{ + SFR.b7 = 0; +} + +int +main (void) +{ + *p = 0xcb; + Do (); + return (*p == 0x4b) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/sfr/22_if1_sfrb_bitfield_0.c b/gcc/testsuite/gcc.target/xstormy16/sfr/22_if1_sfrb_bitfield_0.c new file mode 100644 index 00000000000..bb8489b6c3b --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/22_if1_sfrb_bitfield_0.c @@ -0,0 +1,41 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "b\[np\] " } } */ + +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; + +#define SFRA (*((volatile BitField*)0x7f14)) +unsigned char *pA = (unsigned char *) 0x7f14; +#define SFRB (*((volatile BitField*)0x7f10)) +unsigned char *pB = (unsigned char *) 0x7f10; + +char * +Do (void) +{ + if (SFRA.b0) + { + if (SFRB.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/sfr/22_if1_sfrb_bitfield_3.c b/gcc/testsuite/gcc.target/xstormy16/sfr/22_if1_sfrb_bitfield_3.c new file mode 100644 index 00000000000..96b441c04db --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/22_if1_sfrb_bitfield_3.c @@ -0,0 +1,41 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "b\[np\] " } } */ + +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; + +#define SFRA (*((volatile BitField*)0x7f14)) +unsigned char *pA = (unsigned char *) 0x7f14; +#define SFRB (*((volatile BitField*)0x7f10)) +unsigned char *pB = (unsigned char *) 0x7f10; + +char * +Do (void) +{ + if (SFRA.b3) + { + if (SFRB.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/sfr/22_if1_sfrb_bitfield_7.c b/gcc/testsuite/gcc.target/xstormy16/sfr/22_if1_sfrb_bitfield_7.c new file mode 100644 index 00000000000..ad7bebdc6a6 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/22_if1_sfrb_bitfield_7.c @@ -0,0 +1,41 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "b\[np\] " } } */ + +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; + +#define SFRA (*((volatile BitField*)0x7f14)) +unsigned char *pA = (unsigned char *) 0x7f14; +#define SFRB (*((volatile BitField*)0x7f10)) +unsigned char *pB = (unsigned char *) 0x7f10; + +char * +Do (void) +{ + if (SFRA.b7) + { + if (SFRB.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/sfr/23_if0_sfrb_bitfield_0.c b/gcc/testsuite/gcc.target/xstormy16/sfr/23_if0_sfrb_bitfield_0.c new file mode 100644 index 00000000000..dfa59a939d9 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/23_if0_sfrb_bitfield_0.c @@ -0,0 +1,41 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "b\[np\] " } } */ + +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; + +#define SFRA (*((volatile BitField*)0x7f14)) +unsigned char *pA = (unsigned char *) 0x7f14; +#define SFRB (*((volatile BitField*)0x7f10)) +unsigned char *pB = (unsigned char *) 0x7f10; + +char * +Do (void) +{ + if (!SFRA.b0) + { + if (!SFRB.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/sfr/23_if0_sfrb_bitfield_3.c b/gcc/testsuite/gcc.target/xstormy16/sfr/23_if0_sfrb_bitfield_3.c new file mode 100644 index 00000000000..c311877c761 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/23_if0_sfrb_bitfield_3.c @@ -0,0 +1,41 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "b\[np\] " } } */ + +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; + +#define SFRA (*((volatile BitField*)0x7f14)) +unsigned char *pA = (unsigned char *) 0x7f14; +#define SFRB (*((volatile BitField*)0x7f10)) +unsigned char *pB = (unsigned char *) 0x7f10; + +char * +Do (void) +{ + if (!SFRA.b3) + { + if (!SFRB.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/sfr/23_if0_sfrb_bitfield_7.c b/gcc/testsuite/gcc.target/xstormy16/sfr/23_if0_sfrb_bitfield_7.c new file mode 100644 index 00000000000..2e4eea99095 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/23_if0_sfrb_bitfield_7.c @@ -0,0 +1,41 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "b\[np\] " } } */ + +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; + +#define SFRA (*((volatile BitField*)0x7f14)) +unsigned char *pA = (unsigned char *) 0x7f14; +#define SFRB (*((volatile BitField*)0x7f10)) +unsigned char *pB = (unsigned char *) 0x7f10; + +char * +Do (void) +{ + if (!SFRA.b7) + { + if (!SFRB.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/sfr/24_set_sfrw_bitfield_0.c b/gcc/testsuite/gcc.target/xstormy16/sfr/24_set_sfrw_bitfield_0.c new file mode 100644 index 00000000000..d2351681ce3 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/24_set_sfrw_bitfield_0.c @@ -0,0 +1,39 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "set1 32532,#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; + +#define SFR (*((volatile BitField*)0x7f14)) +unsigned short *p = (unsigned short *) 0x7f14; + +void +Do (void) +{ + SFR.b0 = 1; +} + +int +main (void) +{ + *p = 0x1234; + Do (); + return (*p == 0x1235) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/sfr/24_set_sfrw_bitfield_7.c b/gcc/testsuite/gcc.target/xstormy16/sfr/24_set_sfrw_bitfield_7.c new file mode 100644 index 00000000000..6f1cf87df6e --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/24_set_sfrw_bitfield_7.c @@ -0,0 +1,39 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "set1 32532,#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; + +#define SFR (*((volatile BitField*)0x7f14)) +unsigned short *p = (unsigned short *) 0x7f14; + +void +Do (void) +{ + SFR.b7 = 1; +} + +int +main (void) +{ + *p = 0x1234; + Do (); + return (*p == 0x12b4) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/sfr/24_set_sfrw_bitfield_8.c b/gcc/testsuite/gcc.target/xstormy16/sfr/24_set_sfrw_bitfield_8.c new file mode 100644 index 00000000000..9de4c0def78 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/24_set_sfrw_bitfield_8.c @@ -0,0 +1,39 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "set1 32533,#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; + +#define SFR (*((volatile BitField*)0x7f14)) +unsigned short *p = (unsigned short *) 0x7f14; + +void +Do (void) +{ + SFR.b8 = 1; +} + +int +main (void) +{ + *p = 0x1234; + Do (); + return (*p == 0x1334) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/sfr/24_set_sfrw_bitfield_f.c b/gcc/testsuite/gcc.target/xstormy16/sfr/24_set_sfrw_bitfield_f.c new file mode 100644 index 00000000000..e89757fb6ee --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/24_set_sfrw_bitfield_f.c @@ -0,0 +1,39 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "set1 32533,#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; + +#define SFR (*((volatile BitField*)0x7f14)) +unsigned short *p = (unsigned short *) 0x7f14; + +void +Do (void) +{ + SFR.b15 = 1; +} + +int +main (void) +{ + *p = 0x1234; + Do (); + return (*p == 0x9234) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/sfr/25_clr_sfrw_bitfield_0.c b/gcc/testsuite/gcc.target/xstormy16/sfr/25_clr_sfrw_bitfield_0.c new file mode 100644 index 00000000000..5acd858fc2d --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/25_clr_sfrw_bitfield_0.c @@ -0,0 +1,39 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "clr1 32532,#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; + +#define SFR (*((volatile BitField*)0x7f14)) +unsigned short *p = (unsigned short *) 0x7f14; + +void +Do (void) +{ + SFR.b0 = 0; +} + +int +main (void) +{ + *p = 0xedcb; + Do (); + return (*p == 0xedca) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/sfr/25_clr_sfrw_bitfield_7.c b/gcc/testsuite/gcc.target/xstormy16/sfr/25_clr_sfrw_bitfield_7.c new file mode 100644 index 00000000000..112714e99ab --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/25_clr_sfrw_bitfield_7.c @@ -0,0 +1,39 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "clr1 32532,#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; + +#define SFR (*((volatile BitField*)0x7f14)) +unsigned short *p = (unsigned short *) 0x7f14; + +void +Do (void) +{ + SFR.b7 = 0; +} + +int +main (void) +{ + *p = 0xedcb; + Do (); + return (*p == 0xed4b) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/sfr/25_clr_sfrw_bitfield_8.c b/gcc/testsuite/gcc.target/xstormy16/sfr/25_clr_sfrw_bitfield_8.c new file mode 100644 index 00000000000..015f9bc15db --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/25_clr_sfrw_bitfield_8.c @@ -0,0 +1,39 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "clr1 32533,#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; + +#define SFR (*((volatile BitField*)0x7f14)) +unsigned short *p = (unsigned short *) 0x7f14; + +void +Do (void) +{ + SFR.b8 = 0; +} + +int +main (void) +{ + *p = 0xedcb; + Do (); + return (*p == 0xeccb) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/sfr/25_clr_sfrw_bitfield_f.c b/gcc/testsuite/gcc.target/xstormy16/sfr/25_clr_sfrw_bitfield_f.c new file mode 100644 index 00000000000..0c85ffaa9b6 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/25_clr_sfrw_bitfield_f.c @@ -0,0 +1,39 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "clr1 32533,#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; + +#define SFR (*((volatile BitField*)0x7f14)) +unsigned short *p = (unsigned short *) 0x7f14; + +void +Do (void) +{ + SFR.b15 = 0; +} + +int +main (void) +{ + *p = 0xedcb; + Do (); + return (*p == 0x6dcb) ? 0 : 1; +} diff --git a/gcc/testsuite/gcc.target/xstormy16/sfr/26_if1_sfrw_bitfield_0.c b/gcc/testsuite/gcc.target/xstormy16/sfr/26_if1_sfrw_bitfield_0.c new file mode 100644 index 00000000000..d4861b21bda --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/26_if1_sfrw_bitfield_0.c @@ -0,0 +1,49 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "bn 32532,#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; + +#define SFRA (*((volatile BitField*)0x7f14)) +unsigned short *pA = (unsigned short *) 0x7f14; +#define SFRB (*((volatile BitField*)0x7f10)) +unsigned short *pB = (unsigned short *) 0x7f10; + +char * +Do (void) +{ + if (SFRA.b0) + { + if (SFRB.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/sfr/26_if1_sfrw_bitfield_3.c b/gcc/testsuite/gcc.target/xstormy16/sfr/26_if1_sfrw_bitfield_3.c new file mode 100644 index 00000000000..5318305dbdf --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/26_if1_sfrw_bitfield_3.c @@ -0,0 +1,49 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "bn 32532,#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; + +#define SFRA (*((volatile BitField*)0x7f14)) +unsigned short *pA = (unsigned short *) 0x7f14; +#define SFRB (*((volatile BitField*)0x7f10)) +unsigned short *pB = (unsigned short *) 0x7f10; + +char * +Do (void) +{ + if (SFRA.b3) + { + if (SFRB.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/sfr/26_if1_sfrw_bitfield_7.c b/gcc/testsuite/gcc.target/xstormy16/sfr/26_if1_sfrw_bitfield_7.c new file mode 100644 index 00000000000..85b86a0e97b --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/26_if1_sfrw_bitfield_7.c @@ -0,0 +1,49 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "mov.b r., *32532" } } */ + +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; + +#define SFRA (*((volatile BitField*)0x7f14)) +unsigned short *pA = (unsigned short *) 0x7f14; +#define SFRB (*((volatile BitField*)0x7f10)) +unsigned short *pB = (unsigned short *) 0x7f10; + +char * +Do (void) +{ + if (SFRA.b7) + { + if (SFRB.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/sfr/26_if1_sfrw_bitfield_8.c b/gcc/testsuite/gcc.target/xstormy16/sfr/26_if1_sfrw_bitfield_8.c new file mode 100644 index 00000000000..65412e3f567 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/26_if1_sfrw_bitfield_8.c @@ -0,0 +1,49 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "bn 32533,#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; + +#define SFRA (*((volatile BitField*)0x7f14)) +unsigned short *pA = (unsigned short *) 0x7f14; +#define SFRB (*((volatile BitField*)0x7f10)) +unsigned short *pB = (unsigned short *) 0x7f10; + +char * +Do (void) +{ + if (SFRA.b8) + { + if (SFRB.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/sfr/26_if1_sfrw_bitfield_b.c b/gcc/testsuite/gcc.target/xstormy16/sfr/26_if1_sfrw_bitfield_b.c new file mode 100644 index 00000000000..951db3f2fbd --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/26_if1_sfrw_bitfield_b.c @@ -0,0 +1,49 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "bn 32533,#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; + +#define SFRA (*((volatile BitField*)0x7f14)) +unsigned short *pA = (unsigned short *) 0x7f14; +#define SFRB (*((volatile BitField*)0x7f10)) +unsigned short *pB = (unsigned short *) 0x7f10; + +char * +Do (void) +{ + if (SFRA.b11) + { + if (SFRB.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/sfr/26_if1_sfrw_bitfield_f.c b/gcc/testsuite/gcc.target/xstormy16/sfr/26_if1_sfrw_bitfield_f.c new file mode 100644 index 00000000000..b51daa86202 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/26_if1_sfrw_bitfield_f.c @@ -0,0 +1,49 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "mov.b r., *32533" } } */ + +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; + +#define SFRA (*((volatile BitField*)0x7f14)) +unsigned short *pA = (unsigned short *) 0x7f14; +#define SFRB (*((volatile BitField*)0x7f10)) +unsigned short *pB = (unsigned short *) 0x7f10; + +char * +Do (void) +{ + if (SFRA.b15) + { + if (SFRB.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/sfr/27_if0_sfrw_bitfield_0.c b/gcc/testsuite/gcc.target/xstormy16/sfr/27_if0_sfrw_bitfield_0.c new file mode 100644 index 00000000000..0680d4f03b7 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/27_if0_sfrw_bitfield_0.c @@ -0,0 +1,49 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "bp 32532,#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; + +#define SFRA (*((volatile BitField*)0x7f14)) +unsigned short *pA = (unsigned short *) 0x7f14; +#define SFRB (*((volatile BitField*)0x7f10)) +unsigned short *pB = (unsigned short *) 0x7f10; + +char * +Do (void) +{ + if (!SFRA.b0) + { + if (!SFRB.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/sfr/27_if0_sfrw_bitfield_3.c b/gcc/testsuite/gcc.target/xstormy16/sfr/27_if0_sfrw_bitfield_3.c new file mode 100644 index 00000000000..17f07f907b0 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/27_if0_sfrw_bitfield_3.c @@ -0,0 +1,49 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "bp 32532,#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; + +#define SFRA (*((volatile BitField*)0x7f14)) +unsigned short *pA = (unsigned short *) 0x7f14; +#define SFRB (*((volatile BitField*)0x7f10)) +unsigned short *pB = (unsigned short *) 0x7f10; + +char * +Do (void) +{ + if (!SFRA.b3) + { + if (!SFRB.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/sfr/27_if0_sfrw_bitfield_7.c b/gcc/testsuite/gcc.target/xstormy16/sfr/27_if0_sfrw_bitfield_7.c new file mode 100644 index 00000000000..2c1cab89c56 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/27_if0_sfrw_bitfield_7.c @@ -0,0 +1,49 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "mov.b r., *32532" } } */ + +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; + +#define SFRA (*((volatile BitField*)0x7f14)) +unsigned short *pA = (unsigned short *) 0x7f14; +#define SFRB (*((volatile BitField*)0x7f10)) +unsigned short *pB = (unsigned short *) 0x7f10; + +char * +Do (void) +{ + if (!SFRA.b7) + { + if (!SFRB.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/sfr/27_if0_sfrw_bitfield_8.c b/gcc/testsuite/gcc.target/xstormy16/sfr/27_if0_sfrw_bitfield_8.c new file mode 100644 index 00000000000..2353cad4efa --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/27_if0_sfrw_bitfield_8.c @@ -0,0 +1,49 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "bp 32533,#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; + +#define SFRA (*((volatile BitField*)0x7f14)) +unsigned short *pA = (unsigned short *) 0x7f14; +#define SFRB (*((volatile BitField*)0x7f10)) +unsigned short *pB = (unsigned short *) 0x7f10; + +char * +Do (void) +{ + if (!SFRA.b8) + { + if (!SFRB.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/sfr/27_if0_sfrw_bitfield_b.c b/gcc/testsuite/gcc.target/xstormy16/sfr/27_if0_sfrw_bitfield_b.c new file mode 100644 index 00000000000..123cb060590 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/27_if0_sfrw_bitfield_b.c @@ -0,0 +1,49 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "bp 32533,#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; + +#define SFRA (*((volatile BitField*)0x7f14)) +unsigned short *pA = (unsigned short *) 0x7f14; +#define SFRB (*((volatile BitField*)0x7f10)) +unsigned short *pB = (unsigned short *) 0x7f10; + +char * +Do (void) +{ + if (!SFRA.b11) + { + if (!SFRB.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/sfr/27_if0_sfrw_bitfield_f.c b/gcc/testsuite/gcc.target/xstormy16/sfr/27_if0_sfrw_bitfield_f.c new file mode 100644 index 00000000000..daf5090d228 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/sfr/27_if0_sfrw_bitfield_f.c @@ -0,0 +1,49 @@ +/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ +/* { dg-final { scan-assembler "mov.b r., *32533" } } */ + +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; + +#define SFRA (*((volatile BitField*)0x7f14)) +unsigned short *pA = (unsigned short *) 0x7f14; +#define SFRB (*((volatile BitField*)0x7f10)) +unsigned short *pB = (unsigned short *) 0x7f10; + +char * +Do (void) +{ + if (!SFRA.b15) + { + if (!SFRB.b15) + 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/xstormy16.exp b/gcc/testsuite/gcc.target/xstormy16/xstormy16.exp index 2961cf1b881..49d32ec249d 100644 --- a/gcc/testsuite/gcc.target/xstormy16/xstormy16.exp +++ b/gcc/testsuite/gcc.target/xstormy16/xstormy16.exp @@ -6,18 +6,37 @@ if {![istarget xstormy16-*-*]} { load_lib gcc-dg.exp -# If a testcase doesn't have special options, use these. -global DEFAULT_CFLAGS -if ![info exists DEFAULT_CFLAGS] then { - set DEFAULT_CFLAGS " -ansi -pedantic-errors" -} - # Initialize `dg'. dg-init +# Assemble the below100.S file which contains +# support code for the rest of the tests. +set old-dg-do-what-default "${dg-do-what-default}" +set dg-do-what-default assemble +dg-test -keep-output "$srcdir/$subdir/below100.S" "" "" +set dg-do-what-default run + + # Main loop. -dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] \ - "" $DEFAULT_CFLAGS +foreach testcase [lsort [find $srcdir/$subdir *.c]] { + global test_counts; + + set base "[file rootname [file tail $testcase]]" + + if ![runtest_file_p $runtests $testcase] { + continue + } + + set fails_before $test_counts(FAIL,count) + dg-test $testcase "--save-temps -fno-inline-functions -L$srcdir/$subdir" "" + set fails_after $test_counts(FAIL,count) + + if { $fails_before == $fails_after } { + catch "exec rm -f $base.i $base.s $base.o" + } +} + +set dg-do-what-default "${old-dg-do-what-default}" # All done. dg-finish |