Commit 55badfda by Kaveh R. Ghazi Committed by Kaveh Ghazi

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
parent dadd2dee
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.
......@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment