aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg
diff options
context:
space:
mode:
authorno-author <no-author@gcc.gnu.org>2004-03-02 18:44:48 +0000
committerno-author <no-author@gcc.gnu.org>2004-03-02 18:44:48 +0000
commite2e520b3f8f6e7f9f71bea37ffe2cecfa431a886 (patch)
tree8fe8150a6642b5a88e37f731a87d641f1740642e /gcc/testsuite/gcc.dg
parent583327a5f48e31d05d5840e03dcae28e1c66cb22 (diff)
This commit was manufactured by cvs2svn to create branch
'tree-ssa-20020619-branch'. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/tree-ssa-20020619-branch@78771 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg')
-rw-r--r--gcc/testsuite/gcc.dg/always_inline2.c8
-rw-r--r--gcc/testsuite/gcc.dg/always_inline3.c8
-rw-r--r--gcc/testsuite/gcc.dg/attr-alias-1.c8
-rw-r--r--gcc/testsuite/gcc.dg/charset/asm1.c14
-rw-r--r--gcc/testsuite/gcc.dg/charset/asm3.c33
-rw-r--r--gcc/testsuite/gcc.dg/charset/asm4.c10
-rw-r--r--gcc/testsuite/gcc.dg/charset/asm5.c8
-rw-r--r--gcc/testsuite/gcc.dg/charset/attribute1.c10
-rw-r--r--gcc/testsuite/gcc.dg/charset/attribute2.c8
-rw-r--r--gcc/testsuite/gcc.dg/charset/charset.exp44
-rw-r--r--gcc/testsuite/gcc.dg/charset/string.c5
-rw-r--r--gcc/testsuite/gcc.dg/fixuns-trunc-1.c31
-rw-r--r--gcc/testsuite/gcc.dg/inline-5.c13
13 files changed, 200 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/always_inline2.c b/gcc/testsuite/gcc.dg/always_inline2.c
new file mode 100644
index 00000000000..fa6528d1fac
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/always_inline2.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-Winline -O2" } */
+inline __attribute__ ((always_inline)) void t(void); /* { dg-error "body not available" "" } */
+void
+q(void)
+{
+ t(); /* { dg-error "called from here" "" } */
+}
diff --git a/gcc/testsuite/gcc.dg/always_inline3.c b/gcc/testsuite/gcc.dg/always_inline3.c
new file mode 100644
index 00000000000..b183770adc0
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/always_inline3.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-Winline -O2" } */
+inline __attribute__ ((always_inline)) void
+q2(void)
+{ /* { dg-error "recursive" "" } */
+ q2(); /* { dg-error "called from here" "" } */
+ q2(); /* { dg-error "called from here" "" } */
+}
diff --git a/gcc/testsuite/gcc.dg/attr-alias-1.c b/gcc/testsuite/gcc.dg/attr-alias-1.c
new file mode 100644
index 00000000000..8f530a84ce0
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/attr-alias-1.c
@@ -0,0 +1,8 @@
+/* PR c++/12795 */
+/* { dg-require-alias "" } */
+
+void foo()
+{
+ extern void bar () __attribute__ ((__alias__ ("BAR"))); /* { dg-warning "ignored" } */
+ bar ();
+}
diff --git a/gcc/testsuite/gcc.dg/charset/asm1.c b/gcc/testsuite/gcc.dg/charset/asm1.c
new file mode 100644
index 00000000000..d7578d418f6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/charset/asm1.c
@@ -0,0 +1,14 @@
+/* { dg-do compile }
+ { dg-require-iconv "IBM-1047" }
+ { dg-final { scan-assembler ".ascii bar" } }
+ { dg-final { scan-assembler ".ascii foo" } }
+ */
+extern int x, y;
+
+asm (".ascii bar");
+
+int foo (void)
+{
+ __asm__ (".ascii foo");
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/charset/asm3.c b/gcc/testsuite/gcc.dg/charset/asm3.c
new file mode 100644
index 00000000000..8d8dbbb524d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/charset/asm3.c
@@ -0,0 +1,33 @@
+/* Test for complex asm statements. Make sure it compiles
+ then test for some of the asm statements not being translated. */
+/* { dg-do compile { target i?86-*-* } }
+ { dg-require-iconv "IBM-1047" }
+ { dg-final { scan-assembler "std" } }
+ { dg-final { scan-assembler "cld" } }
+ { dg-final { scan-assembler "rep" } }
+ { dg-final { scan-assembler "movsb" } } */
+#define size_t int
+void *
+memmove (void *__dest, __const void *__src, size_t __n)
+{
+ register unsigned long int __d0, __d1, __d2;
+ if (__dest < __src)
+ __asm__ __volatile__
+ ("cld\n\t"
+ "rep\n\t"
+ "movsb"
+ : "=&c" (__d0), "=&S" (__d1), "=&D" (__d2)
+ : "0" (__n), "1" (__src), "2" (__dest)
+ : "memory");
+ else
+ __asm__ __volatile__
+ ("std\n\t"
+ "rep\n\t"
+ "movsb\n\t"
+ "cld"
+ : "=&c" (__d0), "=&S" (__d1), "=&D" (__d2)
+ : "0" (__n), "1" (__n - 1 + (const char *) __src),
+ "2" (__n - 1 + (char *) __dest)
+ : "memory");
+ return __dest;
+}
diff --git a/gcc/testsuite/gcc.dg/charset/asm4.c b/gcc/testsuite/gcc.dg/charset/asm4.c
new file mode 100644
index 00000000000..cd850c3e81f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/charset/asm4.c
@@ -0,0 +1,10 @@
+/* Simple asm test. */
+/* { dg-do compile }
+ { dg-require-iconv "IBM-1047" }
+ { dg-final { scan-assembler "foo" } } */
+extern int bar;
+
+int main (void)
+{
+ asm ("foo %0" : "=r" (bar));
+}
diff --git a/gcc/testsuite/gcc.dg/charset/asm5.c b/gcc/testsuite/gcc.dg/charset/asm5.c
new file mode 100644
index 00000000000..fa93f40fdaf
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/charset/asm5.c
@@ -0,0 +1,8 @@
+/* Test for string translation. */
+/* { dg-do compile }
+ { dg-require-iconv "IBM-1047" }
+ { dg-final { scan-assembler-not "translate" } } */
+void foo (void)
+{
+ asm ("xx" : : "r"("translate") : "cc");
+}
diff --git a/gcc/testsuite/gcc.dg/charset/attribute1.c b/gcc/testsuite/gcc.dg/charset/attribute1.c
new file mode 100644
index 00000000000..993c7934c80
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/charset/attribute1.c
@@ -0,0 +1,10 @@
+/* Test for attribute non-translation. */
+/* { dg-do compile }
+ { dg-require-iconv "IBM-1047" }
+ { dg-final { scan-assembler "foo" } } */
+int walrus __attribute__ ((section (".foo")));
+
+int main (void)
+{
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/charset/attribute2.c b/gcc/testsuite/gcc.dg/charset/attribute2.c
new file mode 100644
index 00000000000..4ce95a51f84
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/charset/attribute2.c
@@ -0,0 +1,8 @@
+/* Test to make sure that invalid attributes aren't translated.
+ If error recovery is ever testable then "foobar" should be
+ translated. */
+/* { dg-do compile }
+ { dg-require-iconv "IBM-1047" }
+ */
+int foo __attribute__ ((walrus)); /* { dg-error "walrus" "ignored" } */
+char x[] = "foobar";
diff --git a/gcc/testsuite/gcc.dg/charset/charset.exp b/gcc/testsuite/gcc.dg/charset/charset.exp
new file mode 100644
index 00000000000..ad75cb55af8
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/charset/charset.exp
@@ -0,0 +1,44 @@
+# Copyright (C) 2004 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# GCC testsuite that uses the 'dg.exp' driver.
+
+# There's a bunch of headers we need.
+if [is_remote host] {
+ foreach header [glob -nocomplain $srcdir/$subdir/*.{h,def} ] {
+ remote_download host $header
+ }
+}
+
+# Load support procs.
+load_lib gcc-dg.exp
+load_lib target-supports.exp
+
+# If a testcase doesn't have special options, use these.
+global DEFAULT_CHARSETCFLAGS
+if ![info exists DEFAULT_CHARSETCFLAGS] then {
+ set DEFAULT_CHARSETCFLAGS "-fexec-charset=IBM-1047"
+}
+
+# Initialize `dg'.
+dg-init
+
+# Main loop.
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.{c,S} ]] \
+ "" $DEFAULT_CHARSETCFLAGS
+
+# All done.
+dg-finish
diff --git a/gcc/testsuite/gcc.dg/charset/string.c b/gcc/testsuite/gcc.dg/charset/string.c
new file mode 100644
index 00000000000..375e28a2ed6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/charset/string.c
@@ -0,0 +1,5 @@
+/* Simple character translation test. */
+/* { dg-do compile }
+ { dg-require-iconv "IBM-1047" }
+ { dg-final { scan-assembler-not "string foobar" } } */
+char *foo = "string foobar";
diff --git a/gcc/testsuite/gcc.dg/fixuns-trunc-1.c b/gcc/testsuite/gcc.dg/fixuns-trunc-1.c
new file mode 100644
index 00000000000..0d094295249
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/fixuns-trunc-1.c
@@ -0,0 +1,31 @@
+/* { dg-do run } */
+/* { dg-options "-std=c99" } */
+
+unsigned long foo(double d)
+{
+ return (unsigned long) d;
+}
+
+extern void abort(void);
+
+int main(void)
+{
+ double d;
+ unsigned long l;
+
+#ifdef __LP64__
+ d = 9223372036854775808.7;
+ l = 1LL << 63;
+
+ if (foo(d) != l)
+ abort();
+#endif
+
+ d = 122485.2;
+ l = 122485;
+
+ if (foo(d) != l)
+ abort();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/inline-5.c b/gcc/testsuite/gcc.dg/inline-5.c
new file mode 100644
index 00000000000..d72fad65610
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/inline-5.c
@@ -0,0 +1,13 @@
+/* PR middle-end/13448 */
+
+/* { dg-options "-O3" } */
+
+void funct (const int n)
+{
+ n++; /* { dg-error "" } */
+}
+
+int main () {
+ funct (1);
+ return 0;
+}