OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /openrisc/tags/gnu-src/gcc-4.5.1/gcc-4.5.1-or32-1.0rc1/gcc/testsuite/gcc.target/mips/mips-nonpic
    from Rev 321 to Rev 338
    Reverse comparison

Rev 321 → Rev 338

/nonpic-addr.c
0,0 → 1,8
#include "mips-nonpic.h"
int hit_nonpic_addr = 0;
void
nonpic_addr ()
{
nonpic_receive_fn_addr (&nonpic_nothing);
hit_nonpic_addr++;
}
nonpic-addr.c Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: nonpic-call.c =================================================================== --- nonpic-call.c (nonexistent) +++ nonpic-call.c (revision 338) @@ -0,0 +1,9 @@ +#include "mips-nonpic.h" +int hit_nonpic_call = 0; +void +nonpic_call () +{ + pic_nothing (); + pic_addr (); + hit_nonpic_call++; +}
nonpic-call.c Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: mips-nonpic.h =================================================================== --- mips-nonpic.h (nonexistent) +++ mips-nonpic.h (revision 338) @@ -0,0 +1,20 @@ +extern int hit_pic_addr; +extern int hit_pic_addr_call; +extern int hit_pic_nothing; +extern int hit_pic_call; + +extern int hit_nonpic_addr; +extern int hit_nonpic_addr_call; +extern int hit_nonpic_call; +extern int hit_nonpic_nothing; + +extern void nonpic_addr (void); +extern void nonpic_nothing (void); +extern void nonpic_receive_fn_addr (void *); + +extern void pic_addr (void); +extern void pic_receive_fn_addr (void *); +extern void pic_nothing (void); + +extern void abort (void); +extern void exit (int);
mips-nonpic.h Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: main-10.c =================================================================== --- main-10.c (nonexistent) +++ main-10.c (revision 338) @@ -0,0 +1,18 @@ +/* { dg-options "nonpic-call.o pic-addr.o pic-receive-fn-addr.o nonpic-nothing.o pic-nothing.o" } */ + +#include "mips-nonpic.h" + +main () +{ + nonpic_call (); + pic_addr (); + + if (hit_nonpic_call != 1) + abort (); + + if (hit_pic_addr != 2) + abort (); + + exit (0); + +}
main-10.c Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: main-11.c =================================================================== --- main-11.c (nonexistent) +++ main-11.c (revision 338) @@ -0,0 +1,17 @@ +/* { dg-options "nonpic-addr.o pic-addr.o nonpic-receive-fn-addr.o pic-receive-fn-addr.o nonpic-nothing.o pic-nothing.o" } */ + +#include "mips-nonpic.h" + +main () +{ + nonpic_addr (); + pic_addr (); + + if (hit_nonpic_addr != 1) + abort (); + + if (hit_pic_addr != 1) + abort (); + + exit (0); +}
main-11.c Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pic-receive-fn-addr.c =================================================================== --- pic-receive-fn-addr.c (nonexistent) +++ pic-receive-fn-addr.c (revision 338) @@ -0,0 +1,7 @@ +#include "mips-nonpic.h" +void +pic_receive_fn_addr (void *x) +{ + if (x != &pic_nothing) + abort (); +}
pic-receive-fn-addr.c Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: main-12.c =================================================================== --- main-12.c (nonexistent) +++ main-12.c (revision 338) @@ -0,0 +1,17 @@ +/* { dg-options "nonpic-addr-call.o pic-addr.o pic-receive-fn-addr.o nonpic-nothing.o pic-nothing.o" } */ + +#include "mips-nonpic.h" + +main () +{ + nonpic_addr_call (); + pic_addr (); + + if (hit_nonpic_addr_call != 1) + abort (); + + if (hit_pic_addr != 1) + abort (); + + exit (0); +}
main-12.c Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: main-13.c =================================================================== --- main-13.c (nonexistent) +++ main-13.c (revision 338) @@ -0,0 +1,17 @@ +/* { dg-options "pic-addr-call.o nonpic-receive-fn-addr.o nonpic-nothing.o" } */ + +#include "mips-nonpic.h" + +main () +{ + nonpic_nothing (); + pic_addr_call (); + + if (hit_nonpic_nothing != 1) + abort (); + + if (hit_pic_addr_call != 1) + abort (); + + exit (0); +}
main-13.c Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: mips-nonpic.exp =================================================================== --- mips-nonpic.exp (nonexistent) +++ mips-nonpic.exp (revision 338) @@ -0,0 +1,54 @@ +# Copyright (C) 2008 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GCC; see the file COPYING3. If not see +# . + +# GCC testsuite that uses the `dg.exp' driver. +load_lib gcc-dg.exp +load_lib target-supports.exp + +# Exit immediately if this isn't a MIPS target. +if ![istarget mips*-*-*] { + return +} + +# Pic and nonpic are not link-compatible for VXWorks targets. +if [istarget mips*-*-vxworks] { + return +} + +if { ![check_effective_target_fpic] } { + return +} + +dg-init + +set old-dg-do-what-default "${dg-do-what-default}" +set dg-do-what-default "assemble" + +foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/pic-*.c]] { + verbose "Compiling [file tail [file dirname $testcase]]/[file tail $testcase]" + dg-test -keep-output $testcase "-fpic" "" +} + +foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/nonpic-*.c]] { + verbose "Compiling [file tail [file dirname $testcase]]/[file tail $testcase]" + dg-test -keep-output $testcase "-fno-pic" "" +} + +set dg-do-what-default "run" +dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/main-*.c]] "-fno-pic" "" + +set dg-do-what-default "${old-dg-do-what-default}" +dg-finish Index: main-14.c =================================================================== --- main-14.c (nonexistent) +++ main-14.c (revision 338) @@ -0,0 +1,17 @@ +/* { dg-options "nonpic-call.o pic-addr.o pic-receive-fn-addr.o pic-addr-call.o nonpic-receive-fn-addr.o nonpic-nothing.o pic-nothing.o" } */ + +#include "mips-nonpic.h" + +main () +{ + nonpic_call (); + pic_addr_call (); + + if (hit_nonpic_call != 1) + abort (); + + if (hit_pic_addr_call != 1) + abort (); + + exit (0); +}
main-14.c Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: nonpic-addr-call.c =================================================================== --- nonpic-addr-call.c (nonexistent) +++ nonpic-addr-call.c (revision 338) @@ -0,0 +1,8 @@ +#include "mips-nonpic.h" +int hit_nonpic_addr_call = 0; +void +nonpic_addr_call (void) +{ + hit_nonpic_addr_call++; + pic_receive_fn_addr (&pic_nothing); +}
nonpic-addr-call.c Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: main-15.c =================================================================== --- main-15.c (nonexistent) +++ main-15.c (revision 338) @@ -0,0 +1,17 @@ +/* { dg-options "nonpic-addr.o pic-receive-fn-addr.o pic-addr-call.o nonpic-receive-fn-addr.o nonpic-nothing.o pic-nothing.o" } */ + +#include "mips-nonpic.h" + +main () +{ + nonpic_addr (); + pic_addr_call (); + + if (hit_nonpic_addr != 1) + abort (); + + if (hit_pic_addr_call != 1) + abort (); + + exit (0); +}
main-15.c Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: main-16.c =================================================================== --- main-16.c (nonexistent) +++ main-16.c (revision 338) @@ -0,0 +1,17 @@ +/* { dg-options "nonpic-addr-call.o pic-receive-fn-addr.o pic-addr-call.o nonpic-receive-fn-addr.o pic-nothing.o nonpic-nothing.o" } */ + +#include "mips-nonpic.h" + +main () +{ + nonpic_addr_call (); + pic_addr_call (); + + if (hit_nonpic_addr_call != 1) + abort (); + + if (hit_pic_addr_call != 1) + abort (); + + exit (0); +}
main-16.c Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: README =================================================================== --- README (nonexistent) +++ README (revision 338) @@ -0,0 +1,27 @@ +These tests are meant to test the interoperability of PIC and nonpic objects for mips. +This table shows the various combinations and each case is tested by one of the nonpic tests. +Test Case The PIC code The non-PIC code The result (stub and/or PLT) + +main-1.c nothing nothing Neither (trivial) +main-2.c nothing call only PLT entry +main-3.c nothing address taken only Neither (* But creating a PLT entry is valid) +main-4.c nothing address and call PLT entry +main-5.c call only nothing .MIPS.stubs entry +main-6.c call only call only .MIPS.stubs and PLT +main-7.c call only address taken only .MIPS.stubs (* Also creating a PLT entry is valid) +main-8.c call only address and call .MIPS.stubs and PLT entry +main-9.c address taken only nothing Neither +main-10.c address taken only call only PLT entry +main-11.c address taken only address taken only Neither (* But creating a PLT entry is valid) +main-12.c address taken only address and call PLT entry +main-13.c address and call nothing Neither +main-14.c address and call call only PLT entry +main-15.c address and call address taken only Neither (* But creating a PLT entry is valid) +main-16.c address and call address and call PLT entry + + +Copyright (C) 2008 Free Software Foundation, Inc. + +Copying and distribution of this file, with or without modification, +are permitted in any medium without royalty provided the copyright +notice and this notice are preserved.
README Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pic-nothing.c =================================================================== --- pic-nothing.c (nonexistent) +++ pic-nothing.c (revision 338) @@ -0,0 +1,7 @@ +#include "mips-nonpic.h" +int hit_pic_nothing = 0; +void +pic_nothing () +{ + hit_pic_nothing++; +}
pic-nothing.c Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: nonpic-receive-fn-addr.c =================================================================== --- nonpic-receive-fn-addr.c (nonexistent) +++ nonpic-receive-fn-addr.c (revision 338) @@ -0,0 +1,7 @@ +#include "mips-nonpic.h" +void +nonpic_receive_fn_addr (void *x) +{ + if (x != &nonpic_nothing) + abort (); +}
nonpic-receive-fn-addr.c Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: main-1.c =================================================================== --- main-1.c (nonexistent) +++ main-1.c (revision 338) @@ -0,0 +1,17 @@ +/* { dg-options "pic-nothing.o nonpic-nothing.o" } */ + +#include "mips-nonpic.h" + +main () +{ + nonpic_nothing (); + pic_nothing (); + + if (hit_nonpic_nothing != 1) + abort (); + + if (hit_pic_nothing != 1) + abort (); + + exit (0); +}
main-1.c Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: main-2.c =================================================================== --- main-2.c (nonexistent) +++ main-2.c (revision 338) @@ -0,0 +1,17 @@ +/* { dg-options "pic-addr.o nonpic-call.o pic-receive-fn-addr.o nonpic-nothing.o pic-nothing.o" } */ + +#include "mips-nonpic.h" + +main () +{ + nonpic_call (); + pic_nothing (); + + if (hit_nonpic_call != 1) + abort (); + + if (hit_pic_nothing != 2) + abort (); + + exit (0); +}
main-2.c Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pic-addr.c =================================================================== --- pic-addr.c (nonexistent) +++ pic-addr.c (revision 338) @@ -0,0 +1,8 @@ +#include "mips-nonpic.h" +int hit_pic_addr = 0; +void +pic_addr () +{ + pic_receive_fn_addr (&pic_nothing); + hit_pic_addr++; +}
pic-addr.c Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: main-3.c =================================================================== --- main-3.c (nonexistent) +++ main-3.c (revision 338) @@ -0,0 +1,17 @@ +/* { dg-options "nonpic-addr.o nonpic-receive-fn-addr.o nonpic-nothing.o pic-nothing.o" } */ + +#include "mips-nonpic.h" + +main () +{ + nonpic_addr (); + pic_nothing (); + + if (hit_nonpic_addr != 1) + abort (); + + if (hit_pic_nothing != 1) + abort (); + + exit (0); +}
main-3.c Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pic-call.c =================================================================== --- pic-call.c (nonexistent) +++ pic-call.c (revision 338) @@ -0,0 +1,9 @@ +#include "mips-nonpic.h" +int hit_pic_call = 0; +void +pic_call () +{ + nonpic_nothing (); + nonpic_addr (); + hit_pic_call++; +}
pic-call.c Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: main-4.c =================================================================== --- main-4.c (nonexistent) +++ main-4.c (revision 338) @@ -0,0 +1,17 @@ +/* { dg-options "pic-addr.o pic-receive-fn-addr.o nonpic-addr-call.o nonpic-nothing.o pic-nothing.o" } */ + +#include "mips-nonpic.h" + +main () +{ + nonpic_addr_call (); + pic_nothing (); + + if (hit_nonpic_addr_call != 1) + abort (); + + if (hit_pic_nothing != 1) + abort (); + + exit (0); +}
main-4.c Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: main-5.c =================================================================== --- main-5.c (nonexistent) +++ main-5.c (revision 338) @@ -0,0 +1,17 @@ +/* { dg-options "pic-addr.o pic-call.o nonpic-addr.o pic-receive-fn-addr.o nonpic-receive-fn-addr.o nonpic-nothing.o pic-nothing.o" } */ + +#include "mips-nonpic.h" + +main () +{ + nonpic_nothing (); + pic_call (); + + if (hit_nonpic_nothing != 2) + abort (); + + if (hit_pic_call != 1) + abort (); + + exit (0); +}
main-5.c Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: main-6.c =================================================================== --- main-6.c (nonexistent) +++ main-6.c (revision 338) @@ -0,0 +1,17 @@ +/* { dg-options "pic-call.o nonpic-call.o nonpic-addr.o pic-addr.o nonpic-receive-fn-addr.o pic-receive-fn-addr.o nonpic-nothing.o pic-nothing.o" } */ + +#include "mips-nonpic.h" + +main () +{ + pic_call (); + nonpic_call (); + + if (hit_pic_call != 1) + abort (); + + if (hit_nonpic_call != 1) + abort (); + + exit (0); +}
main-6.c Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: main-7.c =================================================================== --- main-7.c (nonexistent) +++ main-7.c (revision 338) @@ -0,0 +1,17 @@ +/* { dg-options "pic-call.o nonpic-addr.o nonpic-receive-fn-addr.o nonpic-nothing.o pic-nothing.o" } */ + +#include "mips-nonpic.h" + +main () +{ + pic_call (); + nonpic_addr (); + + if (hit_pic_call != 1) + abort (); + + if (hit_nonpic_addr != 2) + abort (); + + exit (0); +}
main-7.c Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: main-8.c =================================================================== --- main-8.c (nonexistent) +++ main-8.c (revision 338) @@ -0,0 +1,17 @@ +/* { dg-options "pic-call.o nonpic-addr-call.o nonpic-addr.o nonpic-receive-fn-addr.o pic-receive-fn-addr.o nonpic-nothing.o pic-nothing.o" } */ + +#include "mips-nonpic.h" + +main () +{ + pic_call (); + nonpic_addr_call (); + + if (hit_pic_call != 1) + abort (); + + if (hit_nonpic_addr_call != 1) + abort (); + + exit (0); +}
main-8.c Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: main-9.c =================================================================== --- main-9.c (nonexistent) +++ main-9.c (revision 338) @@ -0,0 +1,10 @@ +/* { dg-options "pic-addr.o pic-receive-fn-addr.o nonpic-nothing.o pic-nothing.o" } */ + +#include "mips-nonpic.h" + +main () +{ + pic_addr (); + nonpic_nothing (); + exit (0); +}
main-9.c Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: nonpic-nothing.c =================================================================== --- nonpic-nothing.c (nonexistent) +++ nonpic-nothing.c (revision 338) @@ -0,0 +1,7 @@ +#include "mips-nonpic.h" +int hit_nonpic_nothing = 0; +void +nonpic_nothing () +{ + hit_nonpic_nothing++; +}
nonpic-nothing.c Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pic-addr-call.c =================================================================== --- pic-addr-call.c (nonexistent) +++ pic-addr-call.c (revision 338) @@ -0,0 +1,8 @@ +#include "mips-nonpic.h" +int hit_pic_addr_call = 0; +void +pic_addr_call (void) +{ + hit_pic_addr_call++; + nonpic_receive_fn_addr (&nonpic_nothing); +}
pic-addr-call.c Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.