This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

string-opt test tweeks


Currently string-opt-3.c fails on alpha-linux because our stub
implementation of strrchr gets called from crt0 code before main.

This is solved by making all of the stub functions static so
that they cannot be invoked from outside the test module.
Note that we do _not_ want to change the declaration to be
static as well, since that would supress the optimization.
Since the testsuite does not use -W, we do not have to worry
about this illiciting a warning.



r~

        * gcc.c-torture/execute/string-opt-1.c: Make stub functions static.
        * gcc.c-torture/execute/string-opt-2.c: Likewise.
        * gcc.c-torture/execute/string-opt-3.c: Likewise.
        * gcc.c-torture/execute/string-opt-4.c: Likewise.

Index: string-opt-1.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/testsuite/gcc.c-torture/execute/string-opt-1.c,v
retrieving revision 1.2
diff -c -p -d -r1.2 string-opt-1.c
*** string-opt-1.c	2000/11/09 09:07:44	1.2
--- string-opt-1.c	2000/11/09 23:19:48
*************** int main()
*** 32,38 ****
  /* When optimizing, all the above cases should be transformed into
     something else.  So any remaining calls to the original function
     should abort.  */
! char *
  strstr(const char *s1, const char *s2)
  {
    abort();
--- 32,38 ----
  /* When optimizing, all the above cases should be transformed into
     something else.  So any remaining calls to the original function
     should abort.  */
! static char *
  strstr(const char *s1, const char *s2)
  {
    abort();
Index: string-opt-2.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/testsuite/gcc.c-torture/execute/string-opt-2.c,v
retrieving revision 1.1
diff -c -p -d -r1.1 string-opt-2.c
*** string-opt-2.c	2000/11/07 16:08:57	1.1
--- string-opt-2.c	2000/11/09 23:19:48
*************** int main()
*** 40,46 ****
  /* When optimizing, all the above cases should be transformed into
     something else.  So any remaining calls to the original function
     should abort.  */
! char *
  strpbrk(const char *s1, const char *s2)
  {
    abort();
--- 40,46 ----
  /* When optimizing, all the above cases should be transformed into
     something else.  So any remaining calls to the original function
     should abort.  */
! static char *
  strpbrk(const char *s1, const char *s2)
  {
    abort();
Index: string-opt-3.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/testsuite/gcc.c-torture/execute/string-opt-3.c,v
retrieving revision 1.1
diff -c -p -d -r1.1 string-opt-3.c
*** string-opt-3.c	2000/11/09 09:07:44	1.1
--- string-opt-3.c	2000/11/09 23:19:48
*************** int main()
*** 63,81 ****
  /* When optimizing, all the above cases should be transformed into
     something else.  So any remaining calls to the original function
     should abort.  */
! __SIZE_TYPE__
  strlen (const char *s)
  {
    abort ();
  }
  
! int
  strcmp (const char *s1, const char *s2)
  {
    abort ();
  }
  
! char *
  strrchr (const char *s, int c)
  {
    abort ();
--- 63,81 ----
  /* When optimizing, all the above cases should be transformed into
     something else.  So any remaining calls to the original function
     should abort.  */
! static __SIZE_TYPE__
  strlen (const char *s)
  {
    abort ();
  }
  
! static int
  strcmp (const char *s1, const char *s2)
  {
    abort ();
  }
  
! static char *
  strrchr (const char *s, int c)
  {
    abort ();
Index: string-opt-4.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/testsuite/gcc.c-torture/execute/string-opt-4.c,v
retrieving revision 1.1
diff -c -p -d -r1.1 string-opt-4.c
*** string-opt-4.c	2000/11/09 09:07:44	1.1
--- string-opt-4.c	2000/11/09 23:19:48
*************** int main()
*** 28,34 ****
  /* When optimizing, all the above cases should be transformed into
     something else.  So any remaining calls to the original function
     should abort.  */
! char *
  strchr (const char *s, int c)
  {
    abort ();
--- 28,34 ----
  /* When optimizing, all the above cases should be transformed into
     something else.  So any remaining calls to the original function
     should abort.  */
! static char *
  strchr (const char *s, int c)
  {
    abort ();

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]