summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2009-03-18 07:09:21 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2009-03-18 07:09:21 +0000
commitcd6c25427bba4f238a1a5170367f99e0566a6519 (patch)
treecab2b3f8b317e78e1fdfda793664698d89838f50 /gcc/testsuite/gcc.dg
parent6776bc017e36e91363badd68384c04e8785044f6 (diff)
downloadgcc-cd6c25427bba4f238a1a5170367f99e0566a6519.tar.gz
2009-03-18 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk r144927 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@144928 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg')
-rw-r--r--gcc/testsuite/gcc.dg/asm-b.c4
-rw-r--r--gcc/testsuite/gcc.dg/compat/struct-layout-1.exp17
-rw-r--r--gcc/testsuite/gcc.dg/debug/pr39412.c16
-rw-r--r--gcc/testsuite/gcc.dg/pr11492.c2
-rw-r--r--gcc/testsuite/gcc.dg/pr39443.c18
-rw-r--r--gcc/testsuite/gcc.dg/pr39455.c13
6 files changed, 55 insertions, 15 deletions
diff --git a/gcc/testsuite/gcc.dg/asm-b.c b/gcc/testsuite/gcc.dg/asm-b.c
index ec9683925c4..beb35f28d8a 100644
--- a/gcc/testsuite/gcc.dg/asm-b.c
+++ b/gcc/testsuite/gcc.dg/asm-b.c
@@ -24,8 +24,8 @@ bar (void)
#if defined (__powerpc__) || defined (__PPC__) || defined (__ppc__) || defined (_POWER) || defined (__ppc64__)
__asm __volatile ("sthbrx %1,0,%2" : "=m" (*z) : "r" (y), "r" (z));
#elif defined __i386__ || defined __x86_64__
- __asm __volatile ("movb %b1,1(%2); movb %h1,(%2)" : "=m" (*z) : "r" (y), "r"
-(z));
+ __asm __volatile ("movb %b1,1(%2)\n\tmovb %h1,(%2)"
+ : "=m" (*z) : "Q" (y), "R" (z));
#endif
return (x & 1) == 0;
}
diff --git a/gcc/testsuite/gcc.dg/compat/struct-layout-1.exp b/gcc/testsuite/gcc.dg/compat/struct-layout-1.exp
index fe42528d56f..e541f6ed3ad 100644
--- a/gcc/testsuite/gcc.dg/compat/struct-layout-1.exp
+++ b/gcc/testsuite/gcc.dg/compat/struct-layout-1.exp
@@ -43,6 +43,7 @@ global compat_have_dfp
# Load procedures from common libraries.
load_lib standard.exp
load_lib gcc.exp
+load_lib target-libpath.exp
# Load the language-dependent compabibility support procedures.
load_lib c-compat.exp
@@ -90,20 +91,12 @@ set generator_src "$generator_src $srcdir/$subdir/generate-random.c"
set generator_src "$generator_src $srcdir/$subdir/generate-random_r.c"
set generator_cmd "-o $generator $skip_dfp $generator_src"
-# Temporarily unset GCC_EXEC_PREFIX from environment, as that might
-# confuse the $HOSTCC.
-set orig_gcc_exec_prefix_saved 0
-if [info exists env(GCC_EXEC_PREFIX)] {
- set orig_gcc_exec_prefix "$env(GCC_EXEC_PREFIX)"
- set orig_gcc_exec_prefix_saved 1
- unsetenv GCC_EXEC_PREFIX
-}
+# Temporarily switch to the environment for the host compiler.
+restore_ld_library_path_env_vars
set status [remote_exec build "$HOSTCC $HOSTCFLAGS $generator_cmd"]
set status [lindex $status 0]
-if { $orig_gcc_exec_prefix_saved } {
- set orig_gcc_exec_prefix_saved 0
- setenv GCC_EXEC_PREFIX "$orig_gcc_exec_prefix"
-}
+set_ld_library_path_env_vars
+
if { $status == 0 } then {
file delete -force $tstobjdir
file mkdir $tstobjdir
diff --git a/gcc/testsuite/gcc.dg/debug/pr39412.c b/gcc/testsuite/gcc.dg/debug/pr39412.c
new file mode 100644
index 00000000000..71b7b5e21a9
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/pr39412.c
@@ -0,0 +1,16 @@
+/* PR debug/39412 */
+/* { dg-do compile } */
+
+struct S { int i; };
+
+inline void
+bar (const void *x, unsigned long y)
+{
+ const union { struct S a[y]; } *u = x;
+}
+
+void
+foo (const void *x, unsigned long y)
+{
+ bar (x, y);
+}
diff --git a/gcc/testsuite/gcc.dg/pr11492.c b/gcc/testsuite/gcc.dg/pr11492.c
index 4a8b617617f..86630995344 100644
--- a/gcc/testsuite/gcc.dg/pr11492.c
+++ b/gcc/testsuite/gcc.dg/pr11492.c
@@ -5,7 +5,7 @@ int main( void )
{
unsigned int a;
unsigned char b;
- for ( a = 0, b = 2; a > b * 1000; a++ ) /* { dg-bogus "comparison between signed and unsigned integer" "" { xfail { ! int32plus } } } */
+ for ( a = 0, b = 2; a > b * 100; a++ ) /* { dg-bogus "comparison between signed and unsigned integer" "" } */
{ ; }
return 0;
diff --git a/gcc/testsuite/gcc.dg/pr39443.c b/gcc/testsuite/gcc.dg/pr39443.c
new file mode 100644
index 00000000000..1baa63a9985
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr39443.c
@@ -0,0 +1,18 @@
+/* PR middle-end/39443 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-final { scan-assembler-not "memcmp" } } */
+
+typedef __SIZE_TYPE__ size_t;
+
+extern int memcmp (const void *s1, const void *s2, size_t n)
+ __attribute__ ((__nothrow__, __pure__));
+extern __typeof (memcmp) memcmp __asm__ ("memory_compare");
+
+int
+test (char *s, char *t, int cnt)
+{
+ if (__builtin_expect (cnt, 0))
+ return memcmp (s, t, cnt);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/pr39455.c b/gcc/testsuite/gcc.dg/pr39455.c
new file mode 100644
index 00000000000..8e8c67034f2
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr39455.c
@@ -0,0 +1,13 @@
+/* PR tree-optimization/39455 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fprefetch-loop-arrays -w" } */
+
+void
+foo (char *x, unsigned long y, unsigned char *z)
+{
+ unsigned int c[256], *d;
+
+ for (d = c + 1; d < c + 256; ++d)
+ *d += d[-1];
+ x[--c[z[y]]] = 0;
+}