From 39d4b51986425bc6afea1a76bebe5cd4da48487c Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Tue, 30 Mar 1993 16:57:45 +0000 Subject: [PATCH] new test cases --- gas/testsuite/gas/.Sanitize | 3 ++ gas/testsuite/gas/gas.exp | 38 +++++++++++------ gas/testsuite/gas/p2389.s | 3 ++ gas/testsuite/gas/p2425a.s | 72 +++++++++++++++++++++++++++++++++ gas/testsuite/gas/sol-cc.s | 81 +++++++++++++++++++++++++++++++++++++ gas/testsuite/gas/sol-gcc.s | 66 ++++++++++++++++++++++++++++++ 6 files changed, 251 insertions(+), 12 deletions(-) create mode 100644 gas/testsuite/gas/p2389.s create mode 100644 gas/testsuite/gas/p2425a.s create mode 100644 gas/testsuite/gas/sol-cc.s create mode 100644 gas/testsuite/gas/sol-gcc.s diff --git a/gas/testsuite/gas/.Sanitize b/gas/testsuite/gas/.Sanitize index 84be40353f9..08834d46290 100644 --- a/gas/testsuite/gas/.Sanitize +++ b/gas/testsuite/gas/.Sanitize @@ -27,8 +27,11 @@ Do-first: Things-to-keep: gas.exp +p2389.s p2425.s p2430.s +sol-cc.s +sol-gcc.s t1.s Do-last: diff --git a/gas/testsuite/gas/gas.exp b/gas/testsuite/gas/gas.exp index 003f4c66db6..362c66edeff 100644 --- a/gas/testsuite/gas/gas.exp +++ b/gas/testsuite/gas/gas.exp @@ -7,12 +7,7 @@ # just checks that exit status is zero # -set testdir $srcdir/gas - -# -# Test empty file, and version number -# -#gas_test_stdout "" "GNU assembler version .* (.*)" +gas_init # # Target-independent tests @@ -25,14 +20,33 @@ gas_test "-al $testdir/p2425.s" "pcrel values in assignment, with listing" # # Some m68k-coff tests # -if [istarget m68k-*-coff] then { - # - # Local branch in non-text section - # +if [istarget m68*-*-coff] then { gas_test "$testdir/p2430.s" "local branch not in text section" + gas_test "$testdir/t1.s" "multiple .file directives" + + gas_test "$testdir/p2389.s" "bss fill" +} + +# +# Some generic m68k tests +# +if [string match m68* $target_cpu] then { # - # Multiple (implicit) .file directives + # Operand size dependent on offset computed using operand size # - gas_test "$testdir/t1.s" "multiple .file directives" + if [file exists "$testdir/p2425a.s"] then { + gas_test "$testdir/p2425a.s" "PR 2425" + } +} + +# +# Solaris-2 on SPARC tests +# +# The two compilers, cc and gcc, generate quite different debugging +# records. Verify that we can accept both. +# +if [istarget sparc-*-solaris2*] then { + gas_test "sol-cc.s" "SPARC Solaris cc -g" + gas_test "sol-gcc.s" "SPARC Solaris gcc -g" } diff --git a/gas/testsuite/gas/p2389.s b/gas/testsuite/gas/p2389.s new file mode 100644 index 00000000000..0475f9dc595 --- /dev/null +++ b/gas/testsuite/gas/p2389.s @@ -0,0 +1,3 @@ + .bss + +_ASIC_INT_TBL: .space 32,0 | keep interrupt routines here diff --git a/gas/testsuite/gas/p2425a.s b/gas/testsuite/gas/p2425a.s new file mode 100644 index 00000000000..60f8dce9105 --- /dev/null +++ b/gas/testsuite/gas/p2425a.s @@ -0,0 +1,72 @@ +WORDSIZE=4 + + .text + .globl _doworm + +_doworm: + moveml a2-a4,sp@- + movl _memsize,d0 + subl #CODESIZE,d0 + addl #0x0,d0 + movl d0,a3 + movl a3,a4 + addl #WORMSIZE,a4 + movl #CODESIZE,sp@- + movl a3,sp@- + movl #worm,sp@- + jsr _bcopy + addl #12,sp + movl a4,a0 + subl #WORDSIZE,a0 + movl sp@(16),a0@ + jsr a3@ + moveml sp@+,a2-a4 + rts + + +worm: + jsr _t_disable + movl #LONGWORMSIZE,d0 + movl a3,a0 + movl #worm,a2 + lea a3@(-WORDSIZE),a1 +crawl: + movl a0@+,a1@ + cmpml a1@+,a2@+ + dbne d0,crawl + jsr _t_enable + subl #WORDSIZE,a3 + jmp a4@ + nop + .long 0 +WORMSIZE=.-worm +LONGWORMSIZE=WORMSIZE/4 + + +manager: + tstw d0 + bgt manerr + cmpl _baseaddr,a3 + beq manfin + jmp a3@ +manerr: + cmpw #1,_noiselevel + blt manerr1 + movl a1,d1 + subl #4,d1 + movl d1,sp@- + movl d0,sp@- + pea errmsg + jsr _printf + addl #12,sp +manerr1: + moveq #0,d0 + bra manret +manfin: + moveq #1,d0 +manret: + rts + nop +CODESIZE=.-worm + +errmsg: .asciz " Premature termination (%d) at %#x" diff --git a/gas/testsuite/gas/sol-cc.s b/gas/testsuite/gas/sol-cc.s new file mode 100644 index 00000000000..8a250dabb93 --- /dev/null +++ b/gas/testsuite/gas/sol-cc.s @@ -0,0 +1,81 @@ + .section ".text" ! [internal] + .proc 4 + .global main + .align 4 + .global main +main: +!#PROLOGUE# 0 +!#PROLOGUE# 1 + save %sp,-96,%sp + sethi %hi(.L18),%o0 + sethi %hi(msg),%o1 + or %o1,%lo(msg),%o1 ! [internal] + call printf,2 + or %o0,%lo(.L18),%o0 ! [internal] + ret + restore %g0,0,%o0 + .type main,#function + .size main,(.-main) + .section ".data" ! [internal] + .align 4 +Ddata.data: + .section ".bss" ! [internal] +Bbss.bss: + .section ".rodata" ! [internal] +Drodata.rodata: + .file "hi-sol.c" + .global msg + .global msg +msg: + .ascii "hello, world!\0" + .type msg,#object + .size msg,14 + .section ".data1", #write, #alloc ! [internal] + .align 4 +.L18: + .ascii "%s\n\0" + .ident "acomp: (CDS) SPARCompilers 2.0.1 03 Sep 1992" + .section "text" ! [internal] + .stabs "/cygint/s1/users/raeburn/",100,0,0,0 + .stabs "hi-sol.c",100,0,3,0 + .stabs "",56,0,0,0 + .stabs "",56,0,0,0 + .stabs "Xt ; g ; O ; V=2.0",60,0,0,0x2bb773ba + .stabs "char:t(0,1)=bsc1;0;8;",128,0,0,0 + .stabs "short:t(0,2)=bs2;0;16;",128,0,0,0 + .stabs "int:t(0,3)=bs4;0;32;",128,0,0,0 + .stabs "long:t(0,4)=bs4;0;32;",128,0,0,0 + .stabs "long long:t(0,5)=bs8;0;64;",128,0,0,0 + .stabs "signed char:t(0,6)=bsc1;0;8;",128,0,0,0 + .stabs "signed short:t(0,7)=bs2;0;16;",128,0,0,0 + .stabs "signed int:t(0,8)=bs4;0;32;",128,0,0,0 + .stabs "signed long:t(0,9)=bs4;0;32;",128,0,0,0 + .stabs "signed long long:t(0,10)=bs8;0;64;",128,0,0,0 + .stabs "unsigned char:t(0,11)=buc1;0;8;",128,0,0,0 + .stabs "unsigned short:t(0,12)=bu2;0;16;",128,0,0,0 + .stabs "unsigned int:t(0,13)=bu4;0;32;",128,0,0,0 + .stabs "unsigned long:t(0,14)=bu4;0;32;",128,0,0,0 + .stabs "unsigned long long:t(0,15)=bu8;0;64;",128,0,0,0 + .stabs "float:t(0,16)=R1;4;",128,0,0,0 + .stabs "double:t(0,17)=R2;8;",128,0,0,0 + .stabs "long double:t(0,18)=R6;16;",128,0,0,0 + .stabs "void:t(0,19)=bs0;0;0",128,0,0,0 + .stabs "msg:G(0,20)=ar(0,3);0;13;(0,1)",32,0,14,0 + .stabs "main:F(0,3);(0,3);(0,21)=*(0,22)=*(0,1)",36,0,0,main + .stabs "main",42,0,0,0 + .stabn 192,0,1,0 + .stabn 68,0,4,0 + .stabs "argc:p(0,3)",160,0,4,68 + .stabs "argv:p(0,21)",160,0,4,72 + .stabs "printf:P(0,3)",36,0,0,0 + .stabn 224,0,1,0 + .stabs "",98,0,0,0 + .section "text" ! [internal] + .xstabs ".stab.index","/cygint/s1/users/raeburn/",100,0,0,0 + .xstabs ".stab.index","hi-sol.c",100,0,3,0 + .xstabs ".stab.index","",56,0,0,0 + .xstabs ".stab.index","",56,0,0,0 + .xstabs ".stab.index","Xt ; g ; O ; V=2.0",60,0,0,0x2bb773ba + .xstabs ".stab.index","msg",32,0,0,0 + .xstabs ".stab.index","main",42,0,0,0 + .xstabs ".stab.index","main",36,0,0,0 diff --git a/gas/testsuite/gas/sol-gcc.s b/gas/testsuite/gas/sol-gcc.s new file mode 100644 index 00000000000..295fdcdd889 --- /dev/null +++ b/gas/testsuite/gas/sol-gcc.s @@ -0,0 +1,66 @@ + .file "hi-sol.c" +.stabs "/1h/devo/src/gas/testsuite/gas/",100,0,0,.LLtext0 +.stabs "hi-sol.c",100,0,0,.LLtext0 +.section ".text" +.LLtext0: + .stabs "gcc2_compiled.", 0x3c, 0, 0, 0 +.stabs "int:t1=r1;-2147483648;2147483647;",128,0,0,0 +.stabs "char:t2=r2;0;127;",128,0,0,0 +.stabs "long int:t3=r1;-2147483648;2147483647;",128,0,0,0 +.stabs "unsigned int:t4=r1;0;-1;",128,0,0,0 +.stabs "long unsigned int:t5=r1;0;-1;",128,0,0,0 +.stabs "short int:t6=r1;-32768;32767;",128,0,0,0 +.stabs "long long int:t7=r1;0;-1;",128,0,0,0 +.stabs "short unsigned int:t8=r1;0;65535;",128,0,0,0 +.stabs "long long unsigned int:t9=r1;0;-1;",128,0,0,0 +.stabs "signed char:t10=r1;-128;127;",128,0,0,0 +.stabs "unsigned char:t11=r1;0;255;",128,0,0,0 +.stabs "float:t12=r1;4;0;",128,0,0,0 +.stabs "double:t13=r1;8;0;",128,0,0,0 +.stabs "long double:t14=r1;8;0;",128,0,0,0 +.stabs "void:t15=15",128,0,0,0 +.stabs "msg:G16=ar1;0;13;2",32,0,0,0 + .global msg +.section ".rodata" + .align 8 + .type msg,#object + .size msg,14 +msg: + .asciz "hello, world!" + .align 8 +.LLC0: + .asciz "%s\n" +.section ".text" + .align 4 +.stabs "main:F1",36,0,0,main +.stabs "argc:P1",64,0,0,24 +.stabs "argv:P17=*18=*2",64,0,0,25 + .global main + .type main,#function + .proc 04 +main: +.stabn 68,0,4,.LM1-main +.LM1: + !#PROLOGUE# 0 + save %sp,-112,%sp + !#PROLOGUE# 1 +.stabn 68,0,5,.LM2-main +.LM2: +.LLBB2: + sethi %hi(.LLC0),%o0 + or %o0,%lo(.LLC0),%o0 + sethi %hi(msg),%o1 + call printf,0 + or %o1,%lo(msg),%o1 +.stabn 68,0,6,.LM3-main +.LM3: +.stabn 68,0,7,.LM4-main +.LM4: +.LLBE2: + ret + restore %g0,0,%o0 +.LLfe1: + .size main,.LLfe1-main +.stabn 192,0,0,.LLBB2-main +.stabn 224,0,0,.LLBE2-main + .ident "GCC: (GNU) cygnus-2.3.3" -- 2.30.2