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.
-/* 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.
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();