From 55badfdae89adc89970ad3aae587e113d66d99d0 Mon Sep 17 00:00:00 2001 From: "Kaveh R. Ghazi" Date: Fri, 1 Apr 2005 13:45:36 +0000 Subject: [PATCH] strncmp-2.c: Also test x86_64. * gcc.c-torture/execute/builtins/strncmp-2.c: Also test x86_64. Fix unused/uninitialized variable warnings. From-SVN: r97387 --- gcc/testsuite/ChangeLog | 3 +++ .../gcc.c-torture/execute/builtins/strncmp-2.c | 10 +++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9305e34da5a..2d00a477aa2 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2005-04-01 Kaveh R. Ghazi + * 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. diff --git a/gcc/testsuite/gcc.c-torture/execute/builtins/strncmp-2.c b/gcc/testsuite/gcc.c-torture/execute/builtins/strncmp-2.c index c9d78783391..fe3462724ea 100644 --- a/gcc/testsuite/gcc.c-torture/execute/builtins/strncmp-2.c +++ b/gcc/testsuite/gcc.c-torture/execute/builtins/strncmp-2.c @@ -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(); -- 2.30.2