OSDN Git Service

* gcc.c-torture/execute/builtins/strncmp-2.c: Also test x86_64.
authorghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 1 Apr 2005 13:45:36 +0000 (13:45 +0000)
committerghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 1 Apr 2005 13:45:36 +0000 (13:45 +0000)
Fix unused/uninitialized variable warnings.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@97387 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/builtins/strncmp-2.c

index 9305e34..2d00a47 100644 (file)
@@ -1,5 +1,8 @@
 2005-04-01  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
+       * gcc.c-torture/execute/builtins/strncmp-2.c: Also test x86_64.
+       Fix unused/uninitialized variable warnings.
+
        * gcc.c-torture/execute/builtins/lib/strncat.c: Fix uninitialized var.
        * gcc.c-torture/execute/builtins/lib/strpbrk.c: Fix discarded const.
        * gcc.c-torture/execute/builtins/strlen-3.c: Fix uninitialized var.
index c9d7878..fe34627 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2001, 2003  Free Software Foundation.
+/* Copyright (C) 2000, 2001, 2003, 2005  Free Software Foundation.
 
    Ensure all expected transformations of builtin strncmp occur and
    perform correctly.
@@ -12,13 +12,13 @@ extern int strncmp (const char *, const char *, size_t);
 void
 main_test (void)
 {
+#if !defined(__OPTIMIZE__) || ((defined(__i386__) || defined (__x86_64__)) && !defined(__OPTIMIZE_SIZE__))
+  /* These tests work on platforms which support cmpstrsi.  We test it
+     at -O0 on all platforms to ensure the strncmp logic is correct.  */
   const char *const s1 = "hello world";
-  const char *s2, *s3;
+  const char *s2;
   int n = 6, x;
   
-#if !defined(__OPTIMIZE__) || (defined(__i386__) && !defined(__OPTIMIZE_SIZE__))
-  /* These tests work on platforms which support cmpstrsi.  We test it
-     at -O0 on all platforms to ensure the strncmp logic is correct.  */
   s2 = s1;
   if (strncmp (++s2, "ello", 3) != 0 || s2 != s1+1)
     abort();