URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
Compare Revisions
- This comparison shows the changes necessary to convert path
/openrisc/trunk/gnu-old/gcc-4.2.2/gcc/testsuite/gcc.dg/torture
- from Rev 154 to Rev 816
- ↔ Reverse comparison
Rev 154 → Rev 816
/mips-sdata-1.c
0,0 → 1,10
/* Check that sdata-accesses are applied regardless of size or ABI. */ |
/* { dg-options -mexplicit-relocs } */ |
/* { dg-do compile { target mips*-*-elf* } } */ |
|
struct s { int x[4]; }; |
struct s my_struct __attribute__((__section__(".sdata"))); |
|
int f() { return my_struct.x[0]; } |
|
/* { dg-final { scan-assembler {gp_?rel\(my_struct} } } */ |
mips-sdata-1.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: builtin-integral-1.c
===================================================================
--- builtin-integral-1.c (nonexistent)
+++ builtin-integral-1.c (revision 816)
@@ -0,0 +1,69 @@
+/* Copyright (C) 2004 Free Software Foundation.
+
+ Verify that integral FP expressions are optimized.
+
+ Written by Kaveh Ghazi, 2004-03-16. */
+
+/* { dg-do link } */
+/* We need -ffinite-math-only so that we can fold "foo != foo", where
+ foo is a floating point expression. We need -fno-math-errno so
+ that various math functions are marked const/pure and can be
+ folded. */
+/* { dg-options "-ffinite-math-only -fno-math-errno" } */
+
+extern int link_failure (int);
+
+/* Test that the various FP truncation builtins detect integral
+ arguments. */
+#define CHECK_FN(MATHFN) \
+ if (__builtin_##MATHFN(i1) != i1) link_failure (__LINE__); \
+ if (__builtin_##MATHFN##f(i1) != i1) link_failure (__LINE__); \
+ if (__builtin_##MATHFN##l(i1) != i1) link_failure (__LINE__);
+
+#define CHECK_FN_RET(MATHFN, RET) \
+ if (__builtin_##MATHFN(i1) != (RET)(double)i1) link_failure (__LINE__); \
+ if (__builtin_##MATHFN##f(i1) != (RET)(float)i1) link_failure (__LINE__); \
+ if (__builtin_##MATHFN##l(i1) != (RET)(long double)i1) link_failure (__LINE__);
+
+ /* Check that various other integral expressions are detected. */
+#define CHECK_EXPR(EXPR,NAME) \
+ if (__builtin_ceill(EXPR) != (EXPR)) link_failure (__LINE__); \
+ if (__builtin_lroundl(EXPR) != (long)(long double)(EXPR)) link_failure (__LINE__);
+
+void __attribute__ ((__noinline__)) test (int i1, int i2)
+{
+ CHECK_FN(ceil);
+ CHECK_FN(floor);
+ CHECK_FN(nearbyint);
+ CHECK_FN(rint);
+ CHECK_FN(round);
+ CHECK_FN(trunc);
+ CHECK_FN_RET(lround, long);
+ CHECK_FN_RET(llround, long long);
+ CHECK_FN_RET(lrint, long);
+ CHECK_FN_RET(llrint, long long);
+ CHECK_FN_RET(lceil, long);
+ CHECK_FN_RET(llceil, long long);
+ CHECK_FN_RET(lfloor, long);
+ CHECK_FN_RET(llfloor, long long);
+
+ CHECK_EXPR (5.0, REAL_CST);
+ CHECK_EXPR (5.0F, REAL_CSTf);
+ CHECK_EXPR (5.0L, REAL_CSTl);
+ CHECK_EXPR ((double)i1, FLOAT_EXPR);
+ CHECK_EXPR ((float)i1, FLOAT_EXPRf);
+ CHECK_EXPR ((long double)i1, FLOAT_EXPRl);
+ CHECK_EXPR (__builtin_fabs(i1), ABS_EXPR);
+ CHECK_EXPR (__builtin_fabsf(i1), ABS_EXPRf);
+ CHECK_EXPR (__builtin_fabsl(i1), ABS_EXPRl);
+ CHECK_EXPR (((void)i1,(double)i2), COMPOUND_EXPR);
+ CHECK_EXPR ((double)i1+i2, PLUS_EXPR);
+ CHECK_EXPR ((double)i1-i2, MINUS_EXPR);
+ CHECK_EXPR ((double)i1*i2, MULT_EXPR);
+}
+
+int main (void)
+{
+ test (1, 2);
+ return 0;
+}
builtin-integral-1.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr20314-2.c
===================================================================
--- pr20314-2.c (nonexistent)
+++ pr20314-2.c (revision 816)
@@ -0,0 +1,47 @@
+/* PR inline-asm/20314 */
+/* { dg-do compile { target { { i?86-*-* x86_64-*-* } && lp64 } } } */
+/* { dg-do compile { target ia64-*-* powerpc*-*-* } } */
+
+int a, b, c, d, e, f, g, h, i, j, k, l;
+
+void
+f1 (void)
+{
+ __asm__ volatile (""
+ : [a] "+r" (a), [b] "+r" (b), [c] "+r" (c), [d] "+r" (d),
+ [e] "+r" (e), [f] "+r" (f), [g] "+r" (g), [h] "+r" (h),
+ [i] "+r" (i), [j] "+r" (j), [k] "+r" (k), [l] "+r" (l));
+}
+
+void
+f2 (void)
+{
+ __asm__ volatile (""
+ : [a] "+r,m" (a), [b] "+r,m" (b), [c] "+r,m" (c), [d] "+r,m" (d),
+ [e] "+r,m" (e), [f] "+r,m" (f), [g] "+r,m" (g), [h] "+r,m" (h),
+ [i] "+r,m" (i), [j] "+r,m" (j), [k] "+r,m" (k), [l] "+r,m" (l));
+}
+
+void
+f3 (void)
+{
+ __asm__ volatile (""
+ : [a] "=r" (a), [b] "=r" (b), [c] "=r" (c), [d] "=r" (d),
+ [e] "=r" (e), [f] "=r" (f), [g] "=r" (g), [h] "=r" (h),
+ [i] "=r" (i), [j] "=r" (j), [k] "=r" (k), [l] "=r" (l)
+ : "[a]" (a), "[b]" (b), "[c]" (c), "[d]" (d),
+ "[e]" (e), "[f]" (f), "[g]" (g), "[h]" (h),
+ "[i]" (i), "[j]" (j), "[k]" (k), "[l]" (l));
+}
+
+void
+f4 (void)
+{
+ __asm__ volatile (""
+ : [a] "=r,m" (a), [b] "=r,m" (b), [c] "=r,m" (c), [d] "=r,m" (d),
+ [e] "=r,m" (e), [f] "=r,m" (f), [g] "=r,m" (g), [h] "=r,m" (h),
+ [i] "=r,m" (i), [j] "=r,m" (j), [k] "=r,m" (k), [l] "=r,m" (l)
+ : "[a],m" (a), "[b],m" (b), "[c],m" (c), "[d],m" (d),
+ "[e],m" (e), "[f],m" (f), "[g],m" (g), "[h],m" (h),
+ "[i],m" (i), "[j],m" (j), "[k],m" (k), "[l],m" (l));
+}
pr20314-2.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr28230.c
===================================================================
--- pr28230.c (nonexistent)
+++ pr28230.c (revision 816)
@@ -0,0 +1,20 @@
+/* { dg-do run } */
+/* { dg-options "-fwrapv" } */
+
+void foo( unsigned long long bb, unsigned short tn, unsigned e, unsigned* w );
+void foo( unsigned long long bb, unsigned short tn, unsigned e, unsigned* w )
+{
+ unsigned n = tn + bb;
+ do {
+ e = (e > n) ? e : *w;
+ n -= (e > n) ? n : e;
+ if (*w)
+ *w = 0;
+ } while ( n );
+}
+int main()
+{
+ unsigned w = 0;
+ foo( 0, 0, 0, &w );
+ return 0;
+}
pr28230.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr27603.c
===================================================================
--- pr27603.c (nonexistent)
+++ pr27603.c (revision 816)
@@ -0,0 +1,16 @@
+/* { dg-do run } */
+
+void exit (int);
+void abort (void);
+int a;
+int main()
+{
+ int j;
+ for (j = 0; j < 6; j++)
+ {
+ if ((unsigned)j - 3 <= 1)
+ exit (0);
+ a = 1000 * (6 - j);
+ }
+ abort ();
+}
pr27603.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr25706-1.c
===================================================================
--- pr25706-1.c (nonexistent)
+++ pr25706-1.c (revision 816)
@@ -0,0 +1,35 @@
+/* { dg-do assemble } */
+/* Invalid assembly generated due to port bug. */
+struct tcp_opt {
+ unsigned int window_clamp;
+ unsigned int rcv_ssthresh;
+ unsigned short advmss;
+};
+extern int sysctl_tcp_app_win;
+void tcp_init_buffer_space(struct tcp_opt *tp, int maxwin)
+{
+ if (tp->window_clamp >= maxwin)
+ if (sysctl_tcp_app_win && maxwin>4*tp->advmss)
+ tp->window_clamp
+ = ({
+ int _x = maxwin;
+ typeof(4*tp->advmss) _y = (4*tp->advmss);
+ _x > _y ? _x : _y;
+ });
+
+ if (sysctl_tcp_app_win
+ && tp->window_clamp > 2*tp->advmss
+ && tp->window_clamp + tp->advmss > maxwin)
+ tp->window_clamp
+ = ({
+ unsigned short _x = maxwin;
+ unsigned short _y = (maxwin-tp->advmss);
+ _x > _y ? _x : _y;
+ });
+ tp->rcv_ssthresh
+ = ({
+ unsigned int _x = (tp->rcv_ssthresh);
+ unsigned int _y = (tp->window_clamp);
+ _x < _y ? _x : _y;
+ });
+}
pr25706-1.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr19462-1.c
===================================================================
--- pr19462-1.c (nonexistent)
+++ pr19462-1.c (revision 816)
@@ -0,0 +1,56 @@
+/* { dg-do compile } */
+/* PR rtl-optimization/19462
+ Delayed branch bug: return insns generated in presence of
+ current_function_epilogue_delay_list. See also PR target/7042. */
+
+/* The test is from newlib/libc/string/wcscspn.c, which has the following
+ copyright and licensing notice, which by inclusion this file supposedly
+ complies with:
+
+ * Copyright (c)1999 Citrus Project,
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE. */
+
+
+unsigned long
+wcscspn(const long *s, const long *set)
+{
+ const long *p;
+ const long *q;
+
+ p = s;
+ while (*p)
+ {
+ q = set;
+ while (*q)
+ {
+ if (*p == *q)
+ goto done;
+ q++;
+ }
+ p++;
+ }
+
+done:
+ return (p - s);
+}
pr19462-1.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr24257.c
===================================================================
--- pr24257.c (nonexistent)
+++ pr24257.c (revision 816)
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fgcse -fgcse-sm" } */
+
+typedef struct A {
+ int buf, left;
+} A;
+
+static void flush(A *s, int n)
+{
+ s->buf <<= n;
+
+ while (s->left < 32) {
+ s->buf <<= 8;
+ s->left += 8;
+ }
+
+ s->buf=0;
+}
+
+void oof(A *s, int n)
+{
+ s->buf = n;
+ s->left = n;
+
+ flush(s, n);
+}
pr24257.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: mips-div-1.c
===================================================================
--- mips-div-1.c (nonexistent)
+++ mips-div-1.c (revision 816)
@@ -0,0 +1,9 @@
+/* Check that hard-float MIPS code doesn't use library calls for 1.0/x. */
+/* { dg-options "-fno-delayed-branch" } */
+/* { dg-do compile { target mips*-*-* } } */
+
+float f1 (float x) { return 1.0f / x; }
+double f2 (double x) { return 1.0 / x; }
+
+/* { dg-final { scan-assembler-not {lwc1.*__divsf3} } } */
+/* { dg-final { scan-assembler-not {ldc1.*__divdf3} } } */
mips-div-1.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr27409.c
===================================================================
--- pr27409.c (nonexistent)
+++ pr27409.c (revision 816)
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+
+typedef struct {
+ struct { } z;
+} thang_t;
+
+struct {
+ short e;
+ thang_t f;
+ int g;
+} my_struct;
+
+void function(int blaz)
+{
+ thang_t *fp = &my_struct.f;
+ foo(fp);
+}
pr27409.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: builtin-rounding-1.c
===================================================================
--- builtin-rounding-1.c (nonexistent)
+++ builtin-rounding-1.c (revision 816)
@@ -0,0 +1,120 @@
+/* Copyright (C) 2004 Free Software Foundation.
+
+ Check that constant folding of the rounding math functions doesn't
+ break anything and produces the expected results.
+
+ Written by Kaveh Ghazi, 2004-04-29. */
+
+/* { dg-do link } */
+
+extern int link_error (int);
+
+#define TEST(FN, VALUE, RESULT) \
+ if (__builtin_##FN (VALUE) != RESULT) link_error (__LINE__); \
+ if (__builtin_##FN##f (VALUE) != RESULT) link_error (__LINE__); \
+ if (__builtin_##FN##l (VALUE) != RESULT) link_error (__LINE__); \
+
+int
+main (void)
+{
+ TEST(trunc, 0, 0);
+ TEST(floor, 0, 0);
+ TEST(ceil, 0, 0);
+ TEST(round, 0, 0);
+ TEST(lround, 0, 0);
+ TEST(llround, 0, 0);
+ TEST(lfloor, 0, 0);
+ TEST(llfloor, 0, 0);
+ TEST(lceil, 0, 0);
+ TEST(llceil, 0, 0);
+
+ TEST(trunc, 6, 6);
+ TEST(floor, 6, 6);
+ TEST(ceil, 6, 6);
+ TEST(round, 6, 6);
+ TEST(lround, 6, 6);
+ TEST(llround, 6, 6);
+ TEST(lfloor, 6, 6);
+ TEST(llfloor, 6, 6);
+ TEST(lceil, 6, 6);
+ TEST(llceil, 6, 6);
+
+ TEST(trunc, -8, -8);
+ TEST(floor, -8, -8);
+ TEST(ceil, -8, -8);
+ TEST(round, -8, -8);
+ TEST(lround, -8, -8);
+ TEST(llround, -8, -8);
+ TEST(lfloor, -8, -8);
+ TEST(llfloor, -8, -8);
+ TEST(lceil, -8, -8);
+ TEST(llceil, -8, -8);
+
+ TEST(trunc, 3.2, 3);
+ TEST(floor, 3.2, 3);
+ TEST(ceil, 3.2, 4);
+ TEST(round, 3.2, 3);
+ TEST(lround, 3.2, 3);
+ TEST(llround, 3.2, 3);
+ TEST(lfloor, 3.2, 3);
+ TEST(llfloor, 3.2, 3);
+ TEST(lceil, 3.2, 4);
+ TEST(llceil, 3.2, 4);
+
+ TEST(trunc, -2.8, -2);
+ TEST(floor, -2.8, -3);
+ TEST(ceil, -2.8, -2);
+ TEST(round, -2.8, -3);
+ TEST(lround, -2.8, -3);
+ TEST(llround, -2.8, -3);
+ TEST(lfloor, -2.8, -3);
+ TEST(llfloor, -2.8, -3);
+ TEST(lceil, -2.8, -2);
+ TEST(llceil, -2.8, -2);
+
+ TEST(trunc, 0.01, 0);
+ TEST(floor, 0.01, 0);
+ TEST(ceil, 0.01, 1);
+ TEST(round, 0.01, 0);
+ TEST(lround, 0.01, 0);
+ TEST(llround, 0.01, 0);
+ TEST(lfloor, 0.01, 0);
+ TEST(llfloor, 0.01, 0);
+ TEST(lceil, 0.01, 1);
+ TEST(llceil, 0.01, 1);
+
+ TEST(trunc, -0.7, 0);
+ TEST(floor, -0.7, -1);
+ TEST(ceil, -0.7, 0);
+ TEST(round, -0.7, -1);
+ TEST(lround, -0.7, -1);
+ TEST(llround, -0.7, -1);
+ TEST(lfloor, -0.7, -1);
+ TEST(llfloor, -0.7, -1);
+ TEST(lceil, -0.7, 0);
+ TEST(llceil, -0.7, 0);
+
+ TEST(trunc, 2.5, 2);
+ TEST(floor, 2.5, 2);
+ TEST(ceil, 2.5, 3);
+ TEST(round, 2.5, 3);
+ TEST(lround, 2.5, 3);
+ TEST(llround, 2.5, 3);
+ TEST(lfloor, 2.5, 2);
+ TEST(llfloor, 2.5, 2);
+ TEST(lceil, 2.5, 3);
+ TEST(llceil, 2.5, 3);
+
+ TEST(trunc, -1.5, -1);
+ TEST(floor, -1.5, -2);
+ TEST(ceil, -1.5, -1);
+ TEST(round, -1.5, -2);
+ TEST(lround, -1.5, -2);
+ TEST(llround, -1.5, -2);
+ TEST(lfloor, -1.5, -2);
+ TEST(llfloor, -1.5, -2);
+ TEST(lceil, -1.5, -1);
+ TEST(llceil, -1.5, -1);
+
+ return 0;
+}
builtin-rounding-1.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr27743.c
===================================================================
--- pr27743.c (nonexistent)
+++ pr27743.c (revision 816)
@@ -0,0 +1,15 @@
+/* { dg-do run } */
+
+extern void abort(void);
+
+int bar(int a)
+{
+ return ((unsigned) ((a) >> 2)) >> 15;
+}
+
+int main()
+{
+ if (bar (0xffff3000) != 0x1ffff)
+ abort ();
+ return 0;
+}
pr27743.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr26258.c
===================================================================
--- pr26258.c (nonexistent)
+++ pr26258.c (revision 816)
@@ -0,0 +1,28 @@
+/* { dg-do run } */
+
+extern void abort(void);
+
+typedef struct Foo { int a; int b; } Foo;
+
+Foo foo(Foo first, Foo last, _Bool ret_first)
+{
+ Foo t;
+ Foo *t1 = (ret_first ? &first : &last);
+ first.a = 2;
+ last.b = 3;
+ t.a = t1->a;
+ t.b = t1->b;
+ t.a += first.a;
+ t.b += last.b;
+ return t;
+}
+
+int main()
+{
+ Foo first = (Foo){1, 2};
+ Foo last = (Foo){3, 4};
+ Foo ret = foo(first, last, 0);
+ if (ret.b != 6)
+ abort ();
+ return 0;
+}
pr26258.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr29446.c
===================================================================
--- pr29446.c (nonexistent)
+++ pr29446.c (revision 816)
@@ -0,0 +1,32 @@
+/* { dg-do compile } */
+
+void f(_Bool D917, int j0, int ubound1, int ubound5)
+{
+ int i, j = j0;
+ int (*abc)[3];
+ i = 1;
+ while (1)
+ {
+ if (j <= 3)
+ while (1)
+ {
+ if (i != j)
+ {
+ if (ubound1 <= 0)
+ return;
+ (*abc)[1] = 0;
+ }
+ else
+ {
+ if (j > ubound1)
+ return;
+ if (ubound5 <= 0)
+ return;
+ }
+ j = j + 1;
+ if (D917)
+ break;
+ }
+ i = i + 1;
+ }
+}
pr29446.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr25947-1.c
===================================================================
--- pr25947-1.c (nonexistent)
+++ pr25947-1.c (revision 816)
@@ -0,0 +1,21 @@
+/* PR target/25947: define_split in cris.md caused unrecognized insn. */
+/* { dg-options "-fpic" { target fpic } } */
+
+extern char *rl_line_buffer;
+extern int rl_point;
+extern int rl_end;
+static const char *vi_motion = " hl^$0ftFT;,%wbeWBE|";
+void
+rl_vi_complete (int ignore, int key)
+{
+ if ((rl_point < rl_end)
+ &&
+ (!(((rl_line_buffer[rl_point]) == ' ')
+ || ((rl_line_buffer[rl_point]) == '\t'))))
+ {
+ if (!
+ (((rl_line_buffer[rl_point + 1]) == ' ')
+ || ((rl_line_buffer[rl_point + 1]) == '\t')))
+ rl_vi_end_word (1, 'E');
+ }
+}
pr25947-1.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: cris-asm-mof-1.c
===================================================================
--- cris-asm-mof-1.c (nonexistent)
+++ cris-asm-mof-1.c (revision 816)
@@ -0,0 +1,35 @@
+/* { dg-do compile { target cris-*-* } } */
+/* { dg-options "-O2 -march=v10" } */
+/* { dg-final { scan-assembler "in-asm: .mof" } } */
+/* { dg-final { scan-assembler "out-asm: .mof" } } */
+/* { dg-final { scan-assembler "in2-asm: .mof" } } */
+/* { dg-final { scan-assembler "out2-asm: .mof" } } */
+
+unsigned int
+in (unsigned int i)
+{
+ register int i0 asm ("mof") = i;
+ asm ("in-asm: %0" : : "x" (i0));
+}
+
+unsigned int
+out (void)
+{
+ register int o asm ("mof");
+ asm ("out-asm: %0" : "=x" (o));
+ return o;
+}
+
+unsigned int
+in2 (unsigned int i)
+{
+ asm ("in2-asm: %0" : : "h" (i));
+}
+
+unsigned int
+out2 (void)
+{
+ unsigned int o;
+ asm ("out2-asm: %0" : "=h" (o));
+ return o;
+}
cris-asm-mof-1.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr29584.c
===================================================================
--- pr29584.c (nonexistent)
+++ pr29584.c (revision 816)
@@ -0,0 +1,28 @@
+/* PR middle-end/29584 */
+/* { dg-do compile } */
+
+extern void *foo1 (void);
+extern void foo2 (void);
+extern void foo3 (void *, void *);
+extern int foo4 (void);
+
+void
+bar (void)
+{
+ int i;
+ void *s;
+ for (i = 1; i < 4; i++)
+ {
+ if (foo4 ())
+ foo2 ();
+ switch (0x8000000UL + i * 0x400)
+ {
+ case 0x80000000UL ... 0x80000000UL + 0x3a000000UL - 1:
+ s = 0;
+ break;
+ default:
+ s = foo1 ();
+ }
+ foo3 ((void *) (0x8000000UL + i * 0x400), s);
+ }
+}
pr29584.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: mips-hilo-2.c
===================================================================
--- mips-hilo-2.c (nonexistent)
+++ mips-hilo-2.c (revision 816)
@@ -0,0 +1,31 @@
+/* Due to a reload inheritance bug, the asm statement in f() would be passed
+ the low part of u.ll on little-endian 32-bit targets. */
+/* { dg-do run { target mips*-*-* } } */
+
+extern void abort (void);
+extern void exit (int);
+
+#if !defined(__mips16)
+unsigned int g;
+
+unsigned long long f (unsigned int x)
+{
+ union { unsigned long long ll; unsigned int parts[2]; } u;
+
+ u.ll = ((unsigned long long) x * x);
+ asm ("mflo\t%0" : "=r" (g) : "l" (u.parts[1]));
+ return u.ll;
+}
+
+int main ()
+{
+ union { unsigned long long ll; unsigned int parts[2]; } u;
+
+ u.ll = f (0x12345678);
+ if (g != u.parts[1])
+ abort ();
+ exit (0);
+}
+#else
+int main () { exit (0); }
+#endif
mips-hilo-2.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: builtin-explog-1.c
===================================================================
--- builtin-explog-1.c (nonexistent)
+++ builtin-explog-1.c (revision 816)
@@ -0,0 +1,233 @@
+/* Copyright (C) 2003, 2004 Free Software Foundation.
+
+ Verify that built-in math function constant folding of log & exp is
+ correctly performed by the compiler.
+
+ Written by Kaveh Ghazi, 2003-09-05. */
+
+/* { dg-do link } */
+/* { dg-options "-ffast-math" } */
+
+/* Define "e" with as many bits as found in builtins.c:dconste. */
+#define M_E 2.7182818284590452353602874713526624977572470936999595749669676277241
+#define M_EF 2.7182818284590452353602874713526624977572470936999595749669676277241F
+#define M_EL 2.7182818284590452353602874713526624977572470936999595749669676277241L
+/* Precision for comparison tests. */
+#define PREC (sizeof (float) < sizeof (double) ? 0.0000001 : PRECF)
+#define PRECF 0.0001F
+#define PRECL (sizeof (float) < sizeof (long double) \
+ ? 0.0000000000001L : PRECF)
+#define PROTOTYPE(FN) extern double FN(double); extern float FN##f(float); \
+ extern long double FN##l(long double);
+#define PROTOTYPE2(FN) extern double FN(double, double); \
+ extern float FN##f(float, float); \
+ extern long double FN##l(long double, long double);
+
+PROTOTYPE(exp)
+PROTOTYPE(exp2)
+PROTOTYPE(exp10)
+PROTOTYPE(log)
+PROTOTYPE(log2)
+PROTOTYPE(log10)
+PROTOTYPE(pow10)
+PROTOTYPE(sqrt)
+PROTOTYPE(cbrt)
+PROTOTYPE2(pow)
+
+void test(double d1, double d2, float f1, float f2,
+ long double ld1, long double ld2)
+{
+ /* Test logN(1) -> 0. */
+#define LOG_1(LOG) \
+ extern void link_failure_##LOG##_1(void); \
+ if (LOG(1.0) != 0.0 || LOG##f(1.0F) != 0.0F || LOG##l(1.0L) != 0.0L) \
+ link_failure_##LOG##_1()
+
+ LOG_1(log);
+ LOG_1(log2);
+ LOG_1(log10);
+
+ /* Test logN(N) -> 1. */
+#define LOG_N(LOG, BASE) \
+ extern void link_failure_##LOG##_N(void); \
+ if (LOG(BASE) != 1.0 || LOG##f(BASE##F) != 1.0F || LOG##l(BASE##L) != 1.0L) \
+ link_failure_##LOG##_N()
+
+ LOG_N(log, M_E);
+ LOG_N(log2, 2.0);
+ LOG_N(log10, 10.0);
+
+ /* Test logN(expN(x)) -> x. */
+#define LOGEXP_SAME(LOG, EXP) \
+ extern void link_failure_##LOG##_##EXP##_same(void); \
+ if (LOG(EXP(d1)) != d1 || LOG##f(EXP##f(f1)) != f1 \
+ || LOG##l(EXP##l(ld1)) != ld1) link_failure_##LOG##_##EXP##_same()
+
+ LOGEXP_SAME(log,exp);
+ LOGEXP_SAME(log2,exp2);
+ LOGEXP_SAME(log10,exp10);
+ LOGEXP_SAME(log10,pow10);
+
+ /* Test logN(expM(x)) -> x*logN(M). */
+#define LOGEXP(LOG, EXP, BASE) \
+ extern void link_failure_##LOG##_##EXP(void); \
+ if (LOG(EXP(d1)) != d1*LOG(BASE) || LOG##f(EXP##f(f1)) != f1*LOG##f(BASE##F) \
+ || LOG##l(EXP##l(ld1)) != ld1*LOG##l(BASE##L)) link_failure_##LOG##_##EXP()
+
+ LOGEXP(log,exp,M_E);
+ LOGEXP(log,exp2,2.0);
+ LOGEXP(log,exp10,10.0);
+ LOGEXP(log,pow10,10.0);
+ LOGEXP(log2,exp,M_E);
+ LOGEXP(log2,exp2,2.0);
+ LOGEXP(log2,exp10,10.0);
+ LOGEXP(log2,pow10,10.0);
+ LOGEXP(log10,exp,M_E);
+ LOGEXP(log10,exp2,2.0);
+ LOGEXP(log10,exp10,10.0);
+ LOGEXP(log10,pow10,10.0);
+
+ /* Test logN(sqrt(x)) -> 0.5*logN(x). */
+#define LOG_SQRT(LOG) \
+ extern void link_failure_##LOG##_sqrt(void); \
+ if (LOG(sqrt(d1)) != 0.5*LOG(d1) || LOG##f(sqrtf(f1)) != 0.5F*LOG##f(f1) \
+ || LOG##l(sqrtl(ld1)) != 0.5L*LOG##l(ld1)) link_failure_##LOG##_sqrt()
+
+ LOG_SQRT(log);
+ LOG_SQRT(log2);
+ LOG_SQRT(log10);
+
+ /* Test sqrt(expN(x)) -> expN(x*0.5). */
+#define SQRT_EXP(EXP) \
+ extern void link_failure_sqrt_##EXP(void); \
+ if (sqrt(EXP(d1)) != EXP(d1*0.5) || sqrtf(EXP##f(f1)) != EXP##f(f1*0.5F) \
+ || sqrtl(EXP##l(ld1)) != EXP##l(ld1*0.5L)) link_failure_sqrt_##EXP()
+
+ SQRT_EXP(exp);
+ SQRT_EXP(exp2);
+ SQRT_EXP(exp10);
+ SQRT_EXP(pow10);
+
+ /* Test logN(cbrt(x)) -> (1/3)*logN(x). */
+#define LOG_CBRT(LOG) \
+ extern void link_failure_##LOG##_cbrt(void); \
+ if (LOG(cbrt(d1)) != (1.0/3)*LOG(d1) \
+ || LOG##f(cbrtf(f1)) != (1.0F/3)*LOG##f(f1) \
+ || LOG##l(cbrtl(ld1)) != (1.0L/3)*LOG##l(ld1)) link_failure_##LOG##_cbrt()
+
+ LOG_CBRT(log);
+ LOG_CBRT(log2);
+ LOG_CBRT(log10);
+
+ /* Test cbrt(expN(x)) -> expN(x/3). */
+#define CBRT_EXP(EXP) \
+ extern void link_failure_cbrt_##EXP(void); \
+ if (cbrt(EXP(d1)) != EXP(d1/3.0) || cbrtf(EXP##f(f1)) != EXP##f(f1/3.0F) \
+ || cbrtl(EXP##l(ld1)) != EXP##l(ld1/3.0L)) link_failure_cbrt_##EXP()
+
+ CBRT_EXP(exp);
+ CBRT_EXP(exp2);
+ CBRT_EXP(exp10);
+ CBRT_EXP(pow10);
+
+ /* Test logN(pow(x,y)) -> y*logN(x). */
+#define LOG_POW(LOG, POW) \
+ extern void link_failure_##LOG##_##POW(void); \
+ if (LOG(POW(d1,d2)) != d2*LOG(d1) || LOG##f(POW##f(f1,f2)) != f2*LOG##f(f1) \
+ || LOG##l(POW##l(ld1,ld2)) != ld2*LOG##l(ld1)) link_failure_##LOG##_##POW()
+
+ LOG_POW(log,pow);
+ LOG_POW(log2,pow);
+ LOG_POW(log10,pow);
+
+ /* Test pow(expN(x),y)) -> expN(x*y). */
+#define POW_EXP(POW, EXP) \
+ extern void link_failure_##POW##_##EXP(void); \
+ if (POW(EXP(d1),d2) != EXP(d1*d2) || POW##f(EXP##f(f1),f2) != EXP##f(f1*f2) \
+ || POW##l(EXP##l(ld1),ld2) != EXP##l(ld1*ld2)) link_failure_##POW##_##EXP()
+
+ POW_EXP(pow, exp);
+ POW_EXP(pow, exp2);
+ POW_EXP(pow, exp10);
+ POW_EXP(pow, pow10);
+
+ /* Test expN(0) -> 1. */
+#define EXP_0(EXP) \
+ extern void link_failure_##EXP##_0(void); \
+ if (EXP(0.0) != 1.0 || EXP##f(0.0F) != 1.0F || EXP##l(0.0L) != 1.0L) \
+ link_failure_##EXP##_0()
+
+ EXP_0(exp);
+ EXP_0(exp2);
+ EXP_0(exp10);
+ EXP_0(pow10);
+
+ /* Test expN(1) -> N. */
+#define EXP_N(EXP, BASE) \
+ extern void link_failure_##EXP##_N(void); \
+ if (EXP(1.0) != BASE || EXP##f(1.0F) != BASE##F || EXP##l(1.0L) != BASE##L) \
+ link_failure_##EXP##_N()
+
+ EXP_N(exp, M_E);
+ EXP_N(exp2, 2.0);
+ EXP_N(exp10, 10.0);
+ EXP_N(pow10, 10.0);
+
+ /* Test expN(integer) -> N*N*N*... */
+#define EXP_INT(EXP, BASE) \
+ extern void link_failure_##EXP##_INT(void); \
+ if (EXP(5.0) < (BASE)*(BASE)*(BASE)*(BASE)*(BASE) - PREC \
+ || EXP(5.0) > (BASE)*(BASE)*(BASE)*(BASE)*(BASE) + PREC \
+ || EXP##f(5.0F) < (BASE##F)*(BASE##F)*(BASE##F)*(BASE##F)*(BASE##F) -PRECF \
+ || EXP##f(5.0F) > (BASE##F)*(BASE##F)*(BASE##F)*(BASE##F)*(BASE##F) +PRECF \
+ || EXP##l(5.0L) < (BASE##L)*(BASE##L)*(BASE##L)*(BASE##L)*(BASE##L) -PRECL \
+ || EXP##l(5.0L) > (BASE##L)*(BASE##L)*(BASE##L)*(BASE##L)*(BASE##L) +PRECL) \
+ link_failure_##EXP##_INT()
+
+ EXP_INT(exp, M_E);
+ EXP_INT(exp2, 2.0);
+ EXP_INT(exp10, 10.0);
+ EXP_INT(pow10, 10.0);
+
+ /* Test expN(logN(x)) -> x. */
+#define EXPLOG_SAME(EXP, LOG) \
+ extern void link_failure_##EXP##_##LOG##_same(void); \
+ if (EXP(LOG(d1)) != d1 || EXP##f(LOG##f(f1)) != f1 \
+ || EXP##l(LOG##l(ld1)) != ld1) link_failure_##EXP##_##LOG##_same()
+
+ EXPLOG_SAME(exp, log);
+ EXPLOG_SAME(exp2, log2);
+ EXPLOG_SAME(exp10, log10);
+ EXPLOG_SAME(pow10, log10);
+
+ /* Test expN(x)*expN(y)) -> expN(x+y). */
+#define EXPXEXP(EXP) \
+ extern void link_failure_##EXP##X##EXP(void); \
+ if (EXP(d1)*EXP(d2) != EXP(d1+d2) || EXP##f(f1)*EXP##f(f2) != EXP##f(f1+f2) \
+ || EXP##l(ld1)*EXP##l(ld2) != EXP##l(ld1+ld2)) link_failure_##EXP##X##EXP()
+
+ EXPXEXP(exp);
+ EXPXEXP(exp2);
+ EXPXEXP(exp10);
+ EXPXEXP(pow10);
+
+ /* Test x/expN(y) -> x*expN(-y). */
+ /* Test expN(x)/expN(y) -> expN(x-y). */
+#define DIVEXP(EXP) \
+ extern void link_failure_div1_##EXP(void); \
+ if (d1/EXP(d2) != d1*EXP(-d2) || f1/EXP##f(f2) != f1*EXP##f(-f2) \
+ || ld1/EXP##l(ld2) != ld1*EXP##l(-ld2)) link_failure_div1_##EXP(); \
+ extern void link_failure_div2_##EXP(void); \
+ if (EXP(d1)/EXP(d2) != EXP(d1-d2) || EXP##f(f1)/EXP##f(f2) != EXP##f(f1-f2) \
+ || EXP##l(ld1)/EXP##l(ld2) != EXP##l(ld1-ld2)) link_failure_div2_##EXP()
+
+ DIVEXP(exp);
+ DIVEXP(exp2);
+ DIVEXP(exp10);
+ DIVEXP(pow10);
+}
+
+int main (void)
+{
+ return 0;
+}
builtin-explog-1.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr26998.c
===================================================================
--- pr26998.c (nonexistent)
+++ pr26998.c (revision 816)
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+
+int decCompareOp (int result)
+{
+ if (result != (int)0x80000000)
+ {
+ result = -result;
+ return (result > 0);
+ }
+ return 0;
+}
pr26998.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: tree-loop-1.c
===================================================================
--- tree-loop-1.c (nonexistent)
+++ tree-loop-1.c (revision 816)
@@ -0,0 +1,21 @@
+/* PR tree-optimization/20640 */
+
+/* After unrolling the loop, we'd turn some conditional branches into
+ unconditional ones, but branch redirection would fail to compute
+ the PHI args for the PHI nodes in the replacement edge
+ destination, so they'd remain NULL causing crashes later on. */
+
+/* { dg-do compile } */
+
+static int a = 0;
+extern int foo (void);
+extern int *bar (void) __attribute__ ((__const__));
+
+void
+test (int x)
+{
+ int b = 10;
+ while (foo () == -1 && *bar () == 4 && b > 0)
+ --b;
+ a = x;
+}
tree-loop-1.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: fp-int-convert-float128.c
===================================================================
--- fp-int-convert-float128.c (nonexistent)
+++ fp-int-convert-float128.c (revision 816)
@@ -0,0 +1,20 @@
+/* Test floating-point conversions. __float128 type. */
+/* Origin: Joseph Myers */
+/* { dg-do run { target { ia64-*-* || { { i?86-*-* x86_64-*-*} && lp64 } } } } */
+/* { dg-xfail-if "" { i?86-*-* x86_64-*-* } { "*" } { "" } } */
+/* { dg-options "" } */
+
+#include "fp-int-convert.h"
+
+#define FLOAT128_MANT_DIG 113
+
+int
+main (void)
+{
+ TEST_I_F(signed char, unsigned char, __float128, FLOAT128_MANT_DIG);
+ TEST_I_F(signed short, unsigned short, __float128, FLOAT128_MANT_DIG);
+ TEST_I_F(signed int, unsigned int, __float128, FLOAT128_MANT_DIG);
+ TEST_I_F(signed long, unsigned long, __float128, FLOAT128_MANT_DIG);
+ TEST_I_F(signed long long, unsigned long long, __float128, FLOAT128_MANT_DIG);
+ exit (0);
+}
fp-int-convert-float128.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: cris-volatile-1.c
===================================================================
--- cris-volatile-1.c (nonexistent)
+++ cris-volatile-1.c (revision 816)
@@ -0,0 +1,72 @@
+/* Copyright (C) 2003 Free Software Foundation.
+ Check that size-optimizations for move insns (specifically peephole
+ optimizations) aren't applied to volatile objects in the CRIS port.
+ Origin: Hans-Peter Nilsson. */
+/* { dg-do compile { target cris-*-* } } */
+/* { dg-final { scan-assembler-not {movu\...\[} } } */
+/* { dg-final { scan-assembler-not {move\.[^d].\[} } } */
+/* { dg-final { scan-assembler-not {and\.[^d].\[} } } */
+/* { dg-final { scan-assembler-not {or\.[^d].\[} } } */
+
+static const unsigned long c = 0x0000FF00;
+unsigned long
+a1 (void)
+{
+ unsigned long m;
+ m = *(volatile unsigned long*) 0xb00000c8;
+ m &= c;
+ return m;
+}
+extern volatile unsigned long xx;
+unsigned long
+a2 (void)
+{
+ unsigned long m;
+ m = xx;
+ m &= c;
+ return m;
+}
+extern volatile unsigned long yy[];
+unsigned long
+a3 (void)
+{
+ unsigned long m;
+ m = yy[3];
+ m &= 0xfe00;
+ return m;
+}
+unsigned long
+ac1 (void)
+{
+ unsigned long m;
+ m = *(volatile unsigned long*) 0xb00000c8;
+ m &= 0xfe00;
+ return m;
+}
+extern volatile unsigned long xx;
+unsigned long
+ac2 (void)
+{
+ unsigned long m;
+ m = xx;
+ m &= 0xfe00;
+ return m;
+}
+extern volatile unsigned long yy[];
+unsigned long
+ac3 (void)
+{
+ unsigned long m;
+ m = yy[3];
+ m &= 0xfe00;
+ return m;
+}
+extern volatile unsigned long yy[];
+unsigned long
+oc3 (void)
+{
+ unsigned long m;
+ m = yy[3];
+ m |= ~0xf;
+ return m;
+}
cris-volatile-1.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: builtin-attr-1.c
===================================================================
--- builtin-attr-1.c (nonexistent)
+++ builtin-attr-1.c (revision 816)
@@ -0,0 +1,435 @@
+/* Copyright (C) 2003, 2005 Free Software Foundation.
+
+ Verify that the `const' function attribute is applied to various
+ builtins and that these functions are optimized away by the
+ compiler under the appropriate circumstances.
+
+ Written by Kaveh Ghazi, 2003-08-04. */
+
+/* { dg-do link } */
+/* { dg-options "-ffast-math" } */
+
+/* These are helper macros to test combinations of functions. We test
+ foo() != foo() with the same arguments, and expect the compiler to
+ optimize away these tests of const functions. */
+
+/* Just test the __builtin_ functions. */
+#define BUILTIN_TEST1(FN, TYPE) \
+extern void link_failure_builtin_##FN(void); \
+void test_builtin_##FN(TYPE x) \
+{ if (__builtin_##FN(x) != __builtin_##FN(x)) link_failure_builtin_##FN(); }
+
+/* Just test the __builtin_ functions. */
+#define BUILTIN_TEST2(FN, TYPE) \
+extern void link_failure_builtin_##FN(void); \
+void test_builtin_##FN(TYPE x, TYPE y) \
+{ if (__builtin_##FN(x,y) != __builtin_##FN(x,y)) link_failure_builtin_##FN(); }
+
+/* Also test the regular (non-__builtin_) function. */
+#define TEST1(FN, TYPE, RTYPE) \
+BUILTIN_TEST1(FN, TYPE) \
+extern void link_failure_##FN(void); \
+extern RTYPE FN(TYPE); \
+void test_##FN(TYPE x) { if (FN(x) != FN(x)) link_failure_##FN(); }
+
+/* Test the __builtin_ functions taking void arguments (with the "f"
+ and "l" variants). */
+#define BUILTIN_FPTEST0(FN) \
+extern void link_failure_builtin_##FN(void); \
+extern void link_failure_builtin_##FN##f(void); \
+extern void link_failure_builtin_##FN##l(void); \
+void test_builtin_##FN(void) \
+{ if (__builtin_##FN() != __builtin_##FN()) link_failure_builtin_##FN(); } \
+void test_builtin_##FN##f(void) \
+{ if (__builtin_##FN##f() != __builtin_##FN##f()) link_failure_builtin_##FN##f(); } \
+void test_builtin_##FN##l(void) \
+{ if (__builtin_##FN##l() != __builtin_##FN##l()) link_failure_builtin_##FN##l(); }
+
+/* Test the __builtin_ functions taking one FP argument (with the "f"
+ and "l" variants). */
+#define BUILTIN_FPTEST1(FN) \
+extern void link_failure_builtin_##FN(void); \
+extern void link_failure_builtin_##FN##f(void); \
+extern void link_failure_builtin_##FN##l(void); \
+void test_builtin_##FN(double d) \
+{ if (__builtin_##FN(d) != __builtin_##FN(d)) link_failure_builtin_##FN(); } \
+void test_builtin_##FN##f(float f) \
+{ if (__builtin_##FN##f(f) != __builtin_##FN##f(f)) link_failure_builtin_##FN##f(); } \
+void test_builtin_##FN##l(long double ld) \
+{ if (__builtin_##FN##l(ld) != __builtin_##FN##l(ld)) link_failure_builtin_##FN##l(); }
+
+/* Test the __builtin_ functions taking one argument of supplied type
+ (with the "f" and "l" variants). */
+#define BUILTIN_FPTEST1ARG(FN, TYPE) \
+extern void link_failure_builtin_##FN(void); \
+extern void link_failure_builtin_##FN##f(void); \
+extern void link_failure_builtin_##FN##l(void); \
+void test_builtin_##FN(TYPE x) \
+{ if (__builtin_##FN(x) != __builtin_##FN(x)) link_failure_builtin_##FN(); } \
+void test_builtin_##FN##f(TYPE x) \
+{ if (__builtin_##FN##f(x) != __builtin_##FN##f(x)) link_failure_builtin_##FN##f(); } \
+void test_builtin_##FN##l(TYPE x) \
+{ if (__builtin_##FN##l(x) != __builtin_##FN##l(x)) link_failure_builtin_##FN##l(); }
+
+/* Test the __builtin_ functions taking two FP arguments (with the "f"
+ and "l" variants). */
+#define BUILTIN_FPTEST2(FN) \
+extern void link_failure_builtin_##FN(void); \
+extern void link_failure_builtin_##FN##f(void); \
+extern void link_failure_builtin_##FN##l(void); \
+void test_builtin_##FN(double d1, double d2) \
+{ if (__builtin_##FN(d1,d2) != __builtin_##FN(d1,d2)) link_failure_builtin_##FN(); } \
+void test_builtin_##FN##f(float f1, float f2) \
+{ if (__builtin_##FN##f(f1,f2) != __builtin_##FN##f(f1,f2)) link_failure_builtin_##FN##f(); } \
+void test_builtin_##FN##l(long double ld1, long double ld2) \
+{ if (__builtin_##FN##l(ld1,ld2) != __builtin_##FN##l(ld1,ld2)) link_failure_builtin_##FN##l(); }
+
+/* Test the __builtin_ functions taking two arguments, the first one
+ is of a supplied type and the second one one is of FP type (with
+ the "f" and "l" variants). */
+#define BUILTIN_FPTEST2ARG1(FN, TYPE) \
+extern void link_failure_builtin_##FN(void); \
+extern void link_failure_builtin_##FN##f(void); \
+extern void link_failure_builtin_##FN##l(void); \
+void test_builtin_##FN(TYPE x, double d) \
+{ if (__builtin_##FN(x,d) != __builtin_##FN(x,d)) link_failure_builtin_##FN(); } \
+void test_builtin_##FN##f(TYPE x, float f) \
+{ if (__builtin_##FN##f(x,f) != __builtin_##FN##f(x,f)) link_failure_builtin_##FN##f(); } \
+void test_builtin_##FN##l(TYPE x, long double ld) \
+{ if (__builtin_##FN##l(x,ld) != __builtin_##FN##l(x,ld)) link_failure_builtin_##FN##l(); }
+
+/* Test the __builtin_ functions taking two arguments, the first one
+ is of FP type and the second one one is of a supplied type (with
+ the "f" and "l" variants). */
+#define BUILTIN_FPTEST2ARG2(FN, TYPE) \
+extern void link_failure_builtin_##FN(void); \
+extern void link_failure_builtin_##FN##f(void); \
+extern void link_failure_builtin_##FN##l(void); \
+void test_builtin_##FN(double d, TYPE x) \
+{ if (__builtin_##FN(d,x) != __builtin_##FN(d,x)) link_failure_builtin_##FN(); } \
+void test_builtin_##FN##f(float f, TYPE x) \
+{ if (__builtin_##FN##f(f,x) != __builtin_##FN##f(f,x)) link_failure_builtin_##FN##f(); } \
+void test_builtin_##FN##l(long double ld, TYPE x) \
+{ if (__builtin_##FN##l(ld,x) != __builtin_##FN##l(ld,x)) link_failure_builtin_##FN##l(); }
+
+/* Test the __builtin_ functions taking three FP arguments (with the
+ "f" and "l" variants). */
+#define BUILTIN_FPTEST3(FN) \
+extern void link_failure_builtin_##FN(void); \
+extern void link_failure_builtin_##FN##f(void); \
+extern void link_failure_builtin_##FN##l(void); \
+void test_builtin_##FN(double d1, double d2, double d3) \
+{ if (__builtin_##FN(d1,d2,d3) != __builtin_##FN(d1,d2,d3)) link_failure_builtin_##FN(); } \
+void test_builtin_##FN##f(float f1, float f2, float f3) \
+{ if (__builtin_##FN##f(f1,f2,f3) != __builtin_##FN##f(f1,f2,f3)) link_failure_builtin_##FN##f(); } \
+void test_builtin_##FN##l(long double ld1, long double ld2, long double ld3) \
+{ if (__builtin_##FN##l(ld1,ld2,ld3) != __builtin_##FN##l(ld1,ld2,ld3)) link_failure_builtin_##FN##l(); }
+
+/* Test the __builtin_ functions taking one complex argument (with the
+ "f" and "l" variants). */
+#define BUILTIN_CPTEST1(FN) \
+extern void link_failure_builtin_##FN(void); \
+extern void link_failure_builtin_##FN##f(void); \
+extern void link_failure_builtin_##FN##l(void); \
+void test_builtin_##FN(_Complex double d) \
+{ if (__builtin_##FN(d) != __builtin_##FN(d)) link_failure_builtin_##FN(); } \
+void test_builtin_##FN##f(_Complex float f) \
+{ if (__builtin_##FN##f(f) != __builtin_##FN##f(f)) link_failure_builtin_##FN##f(); } \
+void test_builtin_##FN##l(_Complex long double ld) \
+{ if (__builtin_##FN##l(ld) != __builtin_##FN##l(ld)) link_failure_builtin_##FN##l(); }
+
+/* Test the __builtin_ functions taking two complex arguments (with
+ the "f" and "l" variants). */
+#define BUILTIN_CPTEST2(FN) \
+extern void link_failure_builtin_##FN(void); \
+extern void link_failure_builtin_##FN##f(void); \
+extern void link_failure_builtin_##FN##l(void); \
+void test_builtin_##FN(_Complex double d1, _Complex double d2) \
+{ if (__builtin_##FN(d1,d2) != __builtin_##FN(d1,d2)) link_failure_builtin_##FN(); } \
+void test_builtin_##FN##f(_Complex float f1, _Complex float f2) \
+{ if (__builtin_##FN##f(f1,f2) != __builtin_##FN##f(f1,f2)) link_failure_builtin_##FN##f(); } \
+void test_builtin_##FN##l(_Complex long double ld1, _Complex long double ld2) \
+{ if (__builtin_##FN##l(ld1,ld2) != __builtin_##FN##l(ld1,ld2)) link_failure_builtin_##FN##l(); }
+
+/* These macros additionally test the non-__builtin_ functions. */
+
+/* Test the functions taking one FP argument (with the "f" and "l"
+ variants) and returning that type. */
+#define FPTEST1(FN) \
+BUILTIN_FPTEST1(FN) \
+extern void link_failure_##FN(void); \
+extern void link_failure_##FN##f(void); \
+extern void link_failure_##FN##l(void); \
+extern double FN(double); \
+extern float FN##f(float); \
+extern long double FN##l(long double); \
+void test_##FN(double d) \
+{ if (FN(d) != FN(d)) link_failure_##FN(); } \
+void test_##FN##f(float f) \
+{ if (FN##f(f) != FN##f(f)) link_failure_##FN##f(); } \
+void test_##FN##l(long double ld) \
+{ if (FN##l(ld) != FN##l(ld)) link_failure_##FN##l(); }
+
+/* Test the functions taking one FP argument (with the "f" and "l"
+ variants) and returning TYPE. */
+#define FPTEST1T(FN, TYPE) \
+BUILTIN_FPTEST1(FN) \
+extern void link_failure_##FN(void); \
+extern void link_failure_##FN##f(void); \
+extern void link_failure_##FN##l(void); \
+extern TYPE FN(double); \
+extern TYPE FN##f(float); \
+extern TYPE FN##l(long double); \
+void test_##FN(double d) \
+{ if (FN(d) != FN(d)) link_failure_##FN(); } \
+void test_##FN##f(float f) \
+{ if (FN##f(f) != FN##f(f)) link_failure_##FN##f(); } \
+void test_##FN##l(long double ld) \
+{ if (FN##l(ld) != FN##l(ld)) link_failure_##FN##l(); }
+
+/* Test the functions taking two FP arguments (with the "f" and "l"
+ variants). */
+#define FPTEST2(FN) \
+BUILTIN_FPTEST2(FN) \
+extern void link_failure_##FN(void); \
+extern void link_failure_##FN##f(void); \
+extern void link_failure_##FN##l(void); \
+extern double FN(double, double); \
+extern float FN##f(float, float); \
+extern long double FN##l(long double, long double); \
+void test_##FN(double d1, double d2) \
+{ if (FN(d1,d2) != FN(d1,d2)) link_failure_##FN(); } \
+void test_##FN##f(float f1, float f2) \
+{ if (FN##f(f1,f2) != FN##f(f1,f2)) link_failure_##FN##f(); } \
+void test_##FN##l(long double ld1, long double ld2) \
+{ if (FN##l(ld1,ld2) != FN##l(ld1,ld2)) link_failure_##FN##l(); }
+
+/* Test the functions taking two arguments, the first one is of a
+ supplied type and the second one one is of FP type (with the "f"
+ and "l" variants). */
+#define FPTEST2ARG1(FN, TYPE) \
+BUILTIN_FPTEST2ARG1(FN, TYPE) \
+extern void link_failure_##FN(void); \
+extern void link_failure_##FN##f(void); \
+extern void link_failure_##FN##l(void); \
+extern double FN(TYPE, double); \
+extern float FN##f(TYPE, float); \
+extern long double FN##l(TYPE, long double); \
+void test_##FN(TYPE x, double d) \
+{ if (FN(x,d) != FN(x,d)) link_failure_##FN(); } \
+void test_##FN##f(TYPE x, float f) \
+{ if (FN##f(x,f) != FN##f(x,f)) link_failure_##FN##f(); } \
+void test_##FN##l(TYPE x, long double ld) \
+{ if (FN##l(x,ld) != FN##l(x,ld)) link_failure_##FN##l(); }
+
+/* Test the functions taking two arguments, the first one is of FP
+ type and the second one one is of a supplied type (with the "f" and
+ "l" variants). */
+#define FPTEST2ARG2(FN, TYPE) \
+BUILTIN_FPTEST2ARG2(FN, TYPE) \
+extern void link_failure_##FN(void); \
+extern void link_failure_##FN##f(void); \
+extern void link_failure_##FN##l(void); \
+extern double FN(double, TYPE); \
+extern float FN##f(float, TYPE); \
+extern long double FN##l(long double, TYPE); \
+void test_##FN(double d, TYPE x) \
+{ if (FN(d,x) != FN(d,x)) link_failure_##FN(); } \
+void test_##FN##f(float f, TYPE x) \
+{ if (FN##f(f,x) != FN##f(f,x)) link_failure_##FN##f(); } \
+void test_##FN##l(long double ld, TYPE x) \
+{ if (FN##l(ld,x) != FN##l(ld,x)) link_failure_##FN##l(); }
+
+/* Test the functions taking three FP arguments (with the "f" and "l"
+ variants). */
+#define FPTEST3(FN) \
+BUILTIN_FPTEST3(FN) \
+extern void link_failure_##FN(void); \
+extern void link_failure_##FN##f(void); \
+extern void link_failure_##FN##l(void); \
+extern double FN(double, double, double); \
+extern float FN##f(float, float, float); \
+extern long double FN##l(long double, long double, long double); \
+void test_##FN(double d1, double d2, double d3) \
+{ if (FN(d1,d2,d3) != FN(d1,d2,d3)) link_failure_##FN(); } \
+void test_##FN##f(float f1, float f2, float f3) \
+{ if (FN##f(f1,f2,f3) != FN##f(f1,f2,f3)) link_failure_##FN##f(); } \
+void test_##FN##l(long double ld1, long double ld2, long double ld3) \
+{ if (FN##l(ld1,ld2,ld3) != FN##l(ld1,ld2,ld3)) link_failure_##FN##l(); }
+
+/* Test the functions taking one complex argument (with the "f" and
+ "l" variants) and returning that type. */
+#define CPTEST1(FN) \
+BUILTIN_CPTEST1(FN) \
+extern void link_failure_##FN(void); \
+extern void link_failure_##FN##f(void); \
+extern void link_failure_##FN##l(void); \
+extern _Complex double FN(_Complex double); \
+extern _Complex float FN##f(_Complex float); \
+extern _Complex long double FN##l(_Complex long double); \
+void test_##FN(_Complex double d) \
+{ if (FN(d) != FN(d)) link_failure_##FN(); } \
+void test_##FN##f(_Complex float f) \
+{ if (FN##f(f) != FN##f(f)) link_failure_##FN##f(); } \
+void test_##FN##l(_Complex long double ld) \
+{ if (FN##l(ld) != FN##l(ld)) link_failure_##FN##l(); }
+
+/* Test the functions taking one complex argument (with the "f" and
+ "l" variants) and returning the real type. */
+#define CPTEST1R(FN) \
+BUILTIN_CPTEST1(FN) \
+extern void link_failure_##FN(void); \
+extern void link_failure_##FN##f(void); \
+extern void link_failure_##FN##l(void); \
+extern double FN(_Complex double); \
+extern float FN##f(_Complex float); \
+extern long double FN##l(_Complex long double); \
+void test_##FN(_Complex double d) \
+{ if (FN(d) != FN(d)) link_failure_##FN(); } \
+void test_##FN##f(_Complex float f) \
+{ if (FN##f(f) != FN##f(f)) link_failure_##FN##f(); } \
+void test_##FN##l(_Complex long double ld) \
+{ if (FN##l(ld) != FN##l(ld)) link_failure_##FN##l(); }
+
+/* Test the functions taking two complex arguments (with the "f" and
+ "l" variants). */
+#define CPTEST2(FN) \
+BUILTIN_CPTEST2(FN) \
+extern void link_failure_##FN(void); \
+extern void link_failure_##FN##f(void); \
+extern void link_failure_##FN##l(void); \
+extern _Complex double FN(_Complex double, _Complex double); \
+extern _Complex float FN##f(_Complex float, _Complex float); \
+extern _Complex long double FN##l(_Complex long double, _Complex long double); \
+void test_##FN(_Complex double d1, _Complex double d2) \
+{ if (FN(d1,d2) != FN(d1,d2)) link_failure_##FN(); } \
+void test_##FN##f(_Complex float f1, _Complex float f2) \
+{ if (FN##f(f1,f2) != FN##f(f1,f2)) link_failure_##FN##f(); } \
+void test_##FN##l(_Complex long double ld1, _Complex long double ld2) \
+{ if (FN##l(ld1,ld2) != FN##l(ld1,ld2)) link_failure_##FN##l(); }
+
+
+/* Test the math builtins. */
+FPTEST1 (acos)
+FPTEST1 (acosh)
+FPTEST1 (asin)
+FPTEST1 (asinh)
+FPTEST1 (atan)
+FPTEST2 (atan2)
+FPTEST1 (atanh)
+FPTEST1 (cbrt)
+FPTEST1 (ceil)
+FPTEST2 (copysign)
+FPTEST1 (cos)
+FPTEST1 (cosh)
+FPTEST2 (drem)
+FPTEST1 (erf)
+FPTEST1 (erfc)
+FPTEST1 (exp)
+FPTEST1 (exp10)
+FPTEST1 (exp2)
+FPTEST1 (expm1)
+FPTEST1 (fabs)
+FPTEST2 (fdim)
+FPTEST1 (floor)
+FPTEST3 (fma)
+FPTEST2 (fmax)
+FPTEST2 (fmin)
+FPTEST2 (fmod)
+BUILTIN_FPTEST0 (huge_val)
+FPTEST2 (hypot)
+FPTEST1T (ilogb, int)
+BUILTIN_FPTEST0 (inf) /* { dg-warning "does not support infinity" "INF unsupported" { target vax-*-* c4x-*-* pdp11-*-* } } */
+FPTEST1 (j0)
+FPTEST1 (j1)
+FPTEST2ARG1 (jn, int)
+FPTEST2ARG2 (ldexp, int)
+BUILTIN_FPTEST1 (llceil)
+BUILTIN_FPTEST1 (llfloor)
+FPTEST1T (llrint, long long)
+FPTEST1T (llround, long long)
+FPTEST1 (log)
+FPTEST1 (log10)
+FPTEST1 (log1p)
+FPTEST1 (log2)
+FPTEST1 (logb)
+BUILTIN_FPTEST1 (lceil)
+BUILTIN_FPTEST1 (lfloor)
+FPTEST1T (lrint, long)
+FPTEST1T (lround, long)
+BUILTIN_FPTEST1ARG (nan, char *)
+BUILTIN_FPTEST1ARG (nans, char *)
+FPTEST1 (nearbyint)
+FPTEST2 (nextafter)
+FPTEST2ARG2 (nexttoward, long double)
+FPTEST2 (pow)
+FPTEST1 (pow10)
+FPTEST2 (remainder)
+FPTEST1 (rint)
+FPTEST1 (round)
+FPTEST2 (scalb)
+FPTEST2ARG2 (scalbn, int)
+FPTEST2ARG2 (scalbln, long int)
+FPTEST1 (significand)
+FPTEST1 (sin)
+FPTEST1 (sinh)
+FPTEST1 (sqrt)
+FPTEST1 (tan)
+FPTEST1 (tanh)
+FPTEST1 (tgamma)
+FPTEST1 (trunc)
+FPTEST1 (y0)
+FPTEST1 (y1)
+FPTEST2ARG1 (yn, int)
+
+/* Test the complex math builtins. */
+/*CPTEST1 (cabs) See http://gcc.gnu.org/ml/gcc-patches/2003-09/msg00040.html */
+CPTEST1 (cacos)
+CPTEST1 (cacosh)
+CPTEST1R (carg)
+CPTEST1 (casin)
+CPTEST1 (casinh)
+CPTEST1 (catan)
+CPTEST1 (catanh)
+CPTEST1 (ccos)
+CPTEST1 (ccosh)
+CPTEST1 (cexp)
+CPTEST1R (cimag)
+CPTEST1 (clog)
+CPTEST1 (conj)
+CPTEST2 (cpow)
+CPTEST1 (cproj)
+CPTEST1R (creal)
+CPTEST1 (csin)
+CPTEST1 (csinh)
+CPTEST1 (csqrt)
+CPTEST1 (ctan)
+CPTEST1 (ctanh)
+
+typedef __INTMAX_TYPE__ intmax_t;
+
+/* Various other const builtins. */
+TEST1 (abs, int, int)
+BUILTIN_TEST1 (clz, int)
+BUILTIN_TEST1 (clzl, long)
+BUILTIN_TEST1 (clzll, long long)
+BUILTIN_TEST1 (ctz, int)
+BUILTIN_TEST1 (ctzl, long)
+BUILTIN_TEST1 (ctzll, long long)
+TEST1 (ffs, int, int)
+TEST1 (ffsl, long, int)
+TEST1 (ffsll, long long, int)
+TEST1 (imaxabs, intmax_t, intmax_t)
+TEST1 (labs, long, long)
+TEST1 (llabs, long long, long long)
+BUILTIN_TEST1 (parity, int)
+BUILTIN_TEST1 (parityl, long)
+BUILTIN_TEST1 (parityll, long long)
+BUILTIN_TEST1 (popcount, int)
+BUILTIN_TEST1 (popcountl, long)
+BUILTIN_TEST1 (popcountll, long long)
+
+int main(void)
+{
+ return 0;
+}
builtin-attr-1.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: fp-int-convert-float.c
===================================================================
--- fp-int-convert-float.c (nonexistent)
+++ fp-int-convert-float.c (revision 816)
@@ -0,0 +1,18 @@
+/* Test floating-point conversions. Standard types and float. */
+/* Origin: Joseph Myers */
+/* { dg-do run } */
+/* { dg-options "" } */
+
+#include
+#include "fp-int-convert.h"
+
+int
+main (void)
+{
+ TEST_I_F(signed char, unsigned char, float, FLT_MANT_DIG);
+ TEST_I_F(signed short, unsigned short, float, FLT_MANT_DIG);
+ TEST_I_F(signed int, unsigned int, float, FLT_MANT_DIG);
+ TEST_I_F(signed long, unsigned long, float, FLT_MANT_DIG);
+ TEST_I_F(signed long long, unsigned long long, float, FLT_MANT_DIG);
+ exit (0);
+}
fp-int-convert-float.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: fp-int-convert.h
===================================================================
--- fp-int-convert.h (nonexistent)
+++ fp-int-convert.h (revision 816)
@@ -0,0 +1,89 @@
+/* Test floating-point conversions. */
+/* Origin: Joseph Myers */
+
+#include
+extern void abort (void);
+extern void exit (int);
+
+/* Not all platforms support TImode integers; logic as in
+ gcc.dg/titype-1.c. */
+#if defined(__LP64__) && !defined(__hppa__)
+typedef int TItype __attribute__ ((mode (TI)));
+typedef unsigned int UTItype __attribute__ ((mode (TI)));
+#else
+typedef long TItype;
+typedef unsigned long UTItype;
+#endif
+
+/* TEST_I_F(I, U, F, P) tests conversions between the pair of signed
+ and unsigned integer types I and U and the floating-point type F,
+ where P is the binary precision of the floating point type. We
+ test conversions of the values 0, 1, 0x7...f, 0x8...0, 0xf...f. We
+ also test conversions of values half way inbetween two
+ representable values (rounding both ways), just above half way, and
+ just below half way. */
+#define TEST_I_F(I, U, F, P) \
+do { \
+ TEST_I_F_VAL (I, F, (I)0, 1); \
+ TEST_I_F_VAL (I, F, (I)1, 1); \
+ TEST_I_F_VAL (I, F, (I)(((U)~(U)0) >> 1), P_OK1 (P, I)); \
+ TEST_I_F_VAL (I, F, (I)(U)~(((U)~(U)0) >> 1), 1); \
+ TEST_I_F_VAL (I, F, (I)(U)~(U)0, P_OK (P, I)); \
+ TEST_I_F_VAL (I, F, HVAL0S (P, I), P_OK (P, I)); \
+ TEST_I_F_VAL (I, F, HVAL0S (P, I) + 1, P_OK (P, I)); \
+ TEST_I_F_VAL (I, F, HVAL0S (P, I) - 1, P_OK (P, I)); \
+ TEST_I_F_VAL (I, F, HVAL1S (P, I), P_OK (P, I)); \
+ TEST_I_F_VAL (I, F, HVAL1S (P, I) + 1, P_OK (P, I)); \
+ TEST_I_F_VAL (I, F, HVAL1S (P, I) - 1, P_OK (P, I)); \
+ TEST_I_F_VAL (I, F, -HVAL0S (P, I), P_OK (P, I)); \
+ TEST_I_F_VAL (I, F, -HVAL0S (P, I) + 1, P_OK (P, I)); \
+ TEST_I_F_VAL (I, F, -HVAL0S (P, I) - 1, P_OK (P, I)); \
+ TEST_I_F_VAL (I, F, -HVAL1S (P, I), P_OK (P, I)); \
+ TEST_I_F_VAL (I, F, -HVAL1S (P, I) + 1, P_OK (P, I)); \
+ TEST_I_F_VAL (I, F, -HVAL1S (P, I) - 1, P_OK (P, I)); \
+ TEST_I_F_VAL (U, F, (U)0, 1); \
+ TEST_I_F_VAL (U, F, (U)1, 1); \
+ TEST_I_F_VAL (U, F, (U)(((U)~(U)0) >> 1), P_OK1 (P, U)); \
+ TEST_I_F_VAL (U, F, (U)~(((U)~(U)0) >> 1), 1); \
+ TEST_I_F_VAL (U, F, (U)~(U)0, P_OK (P, U)); \
+ TEST_I_F_VAL (U, F, HVAL0U (P, U), P_OK (P, U)); \
+ TEST_I_F_VAL (U, F, HVAL0U (P, U) + 1, P_OK (P, U)); \
+ TEST_I_F_VAL (U, F, HVAL0U (P, U) - 1, P_OK (P, U)); \
+ TEST_I_F_VAL (U, F, HVAL1U (P, U), P_OK (P, U)); \
+ TEST_I_F_VAL (U, F, HVAL1U (P, U) + 1, P_OK (P, U)); \
+ TEST_I_F_VAL (U, F, HVAL1U (P, U) - 1, P_OK (P, U)); \
+} while (0)
+
+#define P_OK(P, T) ((P) >= sizeof(T) * CHAR_BIT)
+#define P_OK1(P, T) ((P) >= sizeof(T) * CHAR_BIT - 1)
+#define HVAL0U(P, U) (U)(P_OK (P, U) \
+ ? (U)1 \
+ : (((U)1 << (sizeof(U) * CHAR_BIT - 1)) \
+ + ((U)1 << (sizeof(U) * CHAR_BIT - 1 - P))))
+#define HVAL1U(P, U) (U)(P_OK (P, U) \
+ ? (U)1 \
+ : (((U)1 << (sizeof(U) * CHAR_BIT - 1)) \
+ + ((U)3 << (sizeof(U) * CHAR_BIT - 1 - P))))
+#define HVAL0S(P, S) (S)(P_OK1 (P, S) \
+ ? (S)1 \
+ : (((S)1 << (sizeof(S) * CHAR_BIT - 2)) \
+ + ((S)1 << (sizeof(S) * CHAR_BIT - 2 - P))))
+#define HVAL1S(P, S) (S)(P_OK1 (P, S) \
+ ? (S)1 \
+ : (((S)1 << (sizeof(S) * CHAR_BIT - 2)) \
+ + ((S)3 << (sizeof(S) * CHAR_BIT - 2 - P))))
+
+#define TEST_I_F_VAL(IT, FT, VAL, PREC_OK) \
+do { \
+ static volatile IT ivin, ivout; \
+ static volatile FT fv1, fv2; \
+ ivin = (VAL); \
+ fv1 = (VAL); \
+ fv2 = ivin; \
+ ivout = fv2; \
+ if (ivin != (VAL) \
+ || ((PREC_OK) && ivout != ivin) \
+ || ((PREC_OK) && ivout != (VAL)) \
+ || fv1 != (VAL) || fv2 != (VAL) || fv1 != fv2) \
+ abort (); \
+} while (0)
fp-int-convert.h
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr30364-2.c
===================================================================
--- pr30364-2.c (nonexistent)
+++ pr30364-2.c (revision 816)
@@ -0,0 +1,19 @@
+/* { dg-do run } */
+
+extern void abort (void);
+
+int f(unsigned int a, unsigned int b)
+{
+ if (a > 0x7FFFFFF0) return 0;
+ if (b > 0x7FFFFFF0) return 0;
+
+ int c = (a - 20) + (b - 20);
+ return c > 0x7FFFFFF0;
+}
+
+int main()
+{
+ if (f (0x7FFFFFF0, 41) != 1)
+ abort ();
+ return 0;
+}
pr30364-2.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr27116-2.c
===================================================================
--- pr27116-2.c (nonexistent)
+++ pr27116-2.c (revision 816)
@@ -0,0 +1,13 @@
+/* { dg-do run } */
+
+extern void abort(void);
+
+int main (void)
+{
+ volatile long int n;
+ n = -2;
+
+ if ((-2147483647L - 1L) / (-n) != -1073741824L)
+ abort ();
+ return 0;
+}
pr27116-2.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr27116.c
===================================================================
--- pr27116.c (nonexistent)
+++ pr27116.c (revision 816)
@@ -0,0 +1,15 @@
+/* { dg-do run } */
+
+extern void abort(void);
+
+int f(int a, int b)
+{
+ return (-1 - a) / (-b);
+}
+
+int main()
+{
+ if (f(__INT_MAX__, 2) != __INT_MAX__/2 + 1)
+ abort ();
+ return 0;
+}
pr27116.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr24626-1.c
===================================================================
--- pr24626-1.c (nonexistent)
+++ pr24626-1.c (revision 816)
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+
+typedef long
+(*bla)(int *node);
+
+static long F2(void *tree, long blk, bla after_node_func)
+{
+ long call_result = 0;
+ int *node;
+
+
+ if (call_result = after_node_func(node))
+ goto error_free_node;
+
+ T(node);
+ return 0;
+
+error_free_node:
+ T(node);
+error:
+ return call_result;
+}
+
+long F1(void *tree)
+{
+ return F2(tree, F3(tree), (void *)0);
+}
pr24626-1.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: builtin-convert-2.c
===================================================================
--- builtin-convert-2.c (nonexistent)
+++ builtin-convert-2.c (revision 816)
@@ -0,0 +1,79 @@
+/* Copyright (C) 2004 Free Software Foundation.
+
+ Verify that built-in math function conversion into integer rounding
+ functions is correctly performed by the compiler.
+
+ Written by Kaveh ghazi, 2004-04-26. */
+
+/* { dg-do link } */
+/* { dg-options "-ffast-math" } */
+/* { dg-options "-ffast-math -mmacosx-version-min=10.3" { target powerpc-*-darwin* } } */
+/* { dg-options "-ffast-math -std=c99" { target *-*-solaris2* } } */
+
+#include "../builtins-config.h"
+
+/* Macro to do all FP type combinations. The second half tests
+ narrowing the FP type. */
+#define TEST_FP2FIXED(FN1, FN2) \
+ extern void link_error_##FN1##_##FN2(void); \
+ extern void link_error_##FN1##f_##FN2##f(void); \
+ extern void link_error_##FN1##l_##FN2##l(void); \
+ extern void link_error_##FN1##_l##FN2(void); \
+ extern void link_error_##FN1##f_l##FN2##f(void); \
+ extern void link_error_##FN1##l_l##FN2##l(void); \
+ if ((long)__builtin_##FN1(d) != __builtin_##FN2(d)) \
+ link_error_##FN1##_##FN2(); \
+ if ((long)__builtin_##FN1##f(f) != __builtin_##FN2##f(f)) \
+ link_error_##FN1##f_##FN2##f(); \
+ if ((long)__builtin_##FN1##l(ld) != __builtin_##FN2##l(ld)) \
+ link_error_##FN1##l_##FN2##l(); \
+ if ((long long)__builtin_##FN1(d) != __builtin_l##FN2(d)) \
+ link_error_##FN1##_l##FN2(); \
+ if ((long long)__builtin_##FN1##f(f) != __builtin_l##FN2##f(f)) \
+ link_error_##FN1##f_l##FN2##f(); \
+ if ((long long)__builtin_##FN1##l(ld) != __builtin_l##FN2##l(ld)) \
+ link_error_##FN1##l_l##FN2##l(); \
+ extern void link_error_##FN1##_##FN2##f(void); \
+ extern void link_error_##FN1##l_##FN2(void); \
+ extern void link_error_##FN1##l_##FN2##f(void); \
+ extern void link_error_##FN1##_l##FN2##f(void); \
+ extern void link_error_##FN1##l_l##FN2(void); \
+ extern void link_error_##FN1##l_l##FN2##f(void); \
+ if (sizeof(double) > sizeof(float) \
+ && (long)__builtin_##FN1(f) != __builtin_##FN2##f(f)) \
+ link_error_##FN1##_##FN2##f(); \
+ if (sizeof(long double) > sizeof(double) \
+ && (long)__builtin_##FN1##l(d) != __builtin_##FN2(d)) \
+ link_error_##FN1##l_##FN2(); \
+ if (sizeof(long double) > sizeof(float) \
+ && (long)__builtin_##FN1##l(f) != __builtin_##FN2##f(f)) \
+ link_error_##FN1##l_##FN2##f(); \
+ if (sizeof(double) > sizeof(float) \
+ && (long long)__builtin_##FN1(f) != __builtin_l##FN2##f(f)) \
+ link_error_##FN1##_l##FN2##f(); \
+ if (sizeof(long double) > sizeof(double) \
+ && (long long)__builtin_##FN1##l(d) != __builtin_l##FN2(d)) \
+ link_error_##FN1##l_l##FN2(); \
+ if (sizeof(long double) > sizeof(float) \
+ && (long long)__builtin_##FN1##l(f) != __builtin_l##FN2##f(f)) \
+ link_error_##FN1##l_l##FN2##f()
+
+void __attribute__ ((__noinline__)) foo (double d, float f, long double ld)
+{
+#ifdef __OPTIMIZE__
+# ifdef HAVE_C99_RUNTIME
+ /* The resulting transformation functions are all C99. */
+ TEST_FP2FIXED (ceil, lceil);
+ TEST_FP2FIXED (floor, lfloor);
+ TEST_FP2FIXED (round, lround);
+ TEST_FP2FIXED (nearbyint, lrint);
+ TEST_FP2FIXED (rint, lrint);
+# endif
+#endif
+}
+
+int main()
+{
+ foo (1.0, 2.0, 3.0);
+ return 0;
+}
builtin-convert-2.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr28045.c
===================================================================
--- pr28045.c (nonexistent)
+++ pr28045.c (revision 816)
@@ -0,0 +1,22 @@
+/* { dg-do run } */
+
+extern void abort(void);
+struct a
+{
+ unsigned int bits : 1;
+ signed long val : ((sizeof(long) * 8) - 1);
+};
+int Fnegate (struct a b)
+{
+ if ((-((long)b.val)) <= ((long) ((1UL << ((sizeof(long) * 8) - 2)) -1UL))
+ && (-((long)b.val)) >= (-(((long) ((1UL << ((sizeof(long) * 8) - 2)) -1UL))) - 1))
+ return 0 ;
+ abort ();
+}
+int main ()
+{
+ struct a b = {1, 1};
+ Fnegate (b);
+ return 0;
+}
+
pr28045.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: builtin-convert-4.c
===================================================================
--- builtin-convert-4.c (nonexistent)
+++ builtin-convert-4.c (revision 816)
@@ -0,0 +1,37 @@
+/* Copyright (C) 2007 Free Software Foundation.
+
+ Verify that nearbyint isn't transformed into e.g. rint or lrint
+ when -ftrapping-math is set.
+
+ Written by Kaveh ghazi, 2007-03-04. */
+
+/* { dg-do compile } */
+/* { dg-options "-ftrapping-math -fdump-tree-original" } */
+/* { dg-options "-ftrapping-math -fdump-tree-original -mmacosx-version-min=10.3" { target powerpc-*-darwin* } } */
+/* { dg-options "-ftrapping-math -fdump-tree-original -std=c99" { target *-*-solaris2* } } */
+
+#include "../builtins-config.h"
+
+extern void bar (long);
+
+#define TESTIT(FUNC) do { \
+ bar (__builtin_##FUNC(d)); \
+ bar (__builtin_##FUNC##f(f)); \
+ bar (__builtin_##FUNC##l(ld)); \
+} while (0)
+
+void __attribute__ ((__noinline__)) foo (double d, float f, long double ld)
+{
+ TESTIT(nearbyint);
+}
+
+int main()
+{
+ foo (1.0, 2.0, 3.0);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "nearbyint " 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "nearbyintf" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "nearbyintl" 1 "original" } } */
+/* { dg-final { cleanup-tree-dump "original" } } */
builtin-convert-4.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr24626-3.c
===================================================================
--- pr24626-3.c (nonexistent)
+++ pr24626-3.c (revision 816)
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+
+long fff(int*);
+
+long F2(int *node)
+{
+ long call_result = 0;
+
+ if (call_result = fff(node))
+ goto error_free_node;
+
+ T(node);
+ return 0;
+
+error_free_node:
+ T(node);
+ return call_result;
+}
pr24626-3.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: builtin-nonneg-1.c
===================================================================
--- builtin-nonneg-1.c (nonexistent)
+++ builtin-nonneg-1.c (revision 816)
@@ -0,0 +1,176 @@
+/* Copyright (C) 2004 Free Software Foundation.
+
+ Verify that GCC can determine which built-in functions produce a
+ nonnegative result.
+
+ Written by Kaveh Ghazi, 2004-03-10. */
+
+/* { dg-do link } */
+/* { dg-options "-ffast-math" } */
+
+#define PROTOTYPE_RTYPE(FN,RTYPE) extern RTYPE FN(double); \
+ extern RTYPE FN##f(float); \
+ extern RTYPE FN##l(long double);
+#define PROTOTYPE(FN) extern double FN(double); extern float FN##f(float); \
+ extern long double FN##l(long double);
+#define PROTOTYPE2(FN) extern double FN(double, double); \
+ extern float FN##f(float, float); \
+ extern long double FN##l(long double, long double);
+#define CPROTOTYPE1(FN) extern double FN(_Complex double); \
+ extern float FN##f(_Complex float); \
+ extern long double FN##l(_Complex long double);
+#define CPROTOTYPE1(FN) extern double FN(_Complex double); \
+ extern float FN##f(_Complex float); \
+ extern long double FN##l(_Complex long double);
+#define IPROTOTYPE(FN) extern int FN(int); extern int FN##l(long); \
+ extern int FN##ll(long long);
+#define PROTOTYPE2TYPE2(FN,A2TYPE) extern double FN(double, A2TYPE); \
+ extern float FN##f(float, A2TYPE); \
+ extern long double FN##l(long double, A2TYPE);
+#define PROTOTYPE2_A2FPTR(FN) extern double FN(double, double *); \
+ extern float FN##f(float, float *); \
+ extern long double FN##l(long double, long double *);
+
+extern int signbit (double);
+extern int signbitf (float);
+extern int signbitl (long double);
+
+void test(double d1, double d2, float f1, float f2,
+ long double ld1, long double ld2)
+{
+ /* These are always nonnegative. */
+
+#define TEST1(FN) \
+ extern void link_failure_##FN (void); PROTOTYPE(FN) \
+ if (signbit(FN(d1)) || signbitf(FN##f(f1)) || signbitl(FN##l(ld1))) \
+ link_failure_##FN()
+
+#define TEST2(FN) \
+ extern void link_failure_##FN (void); PROTOTYPE2(FN) \
+ if (signbit(FN(d1,d2)) || signbitf(FN##f(f1,f2)) || signbitl(FN##l(ld1,ld2))) \
+ link_failure_##FN()
+
+#define CTEST1(FN) \
+ extern void link_failure_##FN (void); CPROTOTYPE1(FN) \
+ if (signbit(FN(d1)) || signbitf(FN##f(f1)) || signbitl(FN##l(ld1))) \
+ link_failure_##FN()
+
+#define ITEST1(FN) \
+ extern void link_failure_##FN (void); IPROTOTYPE(FN) \
+ if (signbit(FN(d1)) || signbitf(FN##l(f1)) || signbitl(FN##ll(ld1))) \
+ link_failure_##FN()
+
+ TEST1 (acos);
+ TEST1 (acosh);
+ CTEST1 (cabs);
+ TEST1 (cosh);
+ TEST1 (erfc);
+ TEST1 (exp);
+ TEST1 (exp10);
+ TEST1 (exp2);
+ TEST1 (fabs);
+ TEST2 (fdim);
+ TEST2 (hypot);
+ TEST1 (pow10);
+ TEST1 (sqrt);
+ ITEST1 (ffs);
+ ITEST1 (__builtin_parity);
+ ITEST1 (__builtin_popcount);
+
+ /* These are nonnegative if the first argument is. */
+#define ARG1TEST1(FN) \
+ extern void link_failure_##FN (void); PROTOTYPE(FN) \
+ if (signbit(FN(fabs(d1))) || signbitf(FN##f(fabsf(f1))) \
+ || signbitl(FN##l(fabsl(ld1)))) \
+ link_failure_##FN()
+
+ /* Same, but allow specifying the return type. */
+#define ARG1TEST1_RTYPE(FN,RTYPE) \
+ extern void link_failure_##FN (void); PROTOTYPE_RTYPE(FN,RTYPE) \
+ if (signbit(FN(fabs(d1))) || signbitf(FN##f(fabsf(f1))) \
+ || signbitl(FN##l(fabsl(ld1)))) \
+ link_failure_##FN()
+
+ /* These are nonnegative if the first argument is. */
+#define ARG1TEST2(FN) \
+ extern void link_failure_##FN (void); PROTOTYPE2(FN) \
+ if (signbit(FN(fabs(d1),d2)) || signbitf(FN##f(fabsf(f1),f2)) \
+ || signbitl(FN##l(fabsl(ld1),ld2))) \
+ link_failure_##FN()
+
+ /* These are nonnegative if the second argument is. */
+#define ARG2TEST2(FN) \
+ extern void link_failure_##FN (void); PROTOTYPE2(FN) \
+ if (signbit(FN(d1,fabs(d2))) || signbitf(FN##f(f1,fabsf(f2))) \
+ || signbitl(FN##l(ld1,fabsl(ld2)))) \
+ link_failure_##FN()
+
+ /* These are nonnegative if the first OR second argument is. */
+#define ARG2TESTor(FN) \
+ extern void link_failure_##FN (void); PROTOTYPE2(FN) \
+ if (signbit(FN(fabs(d1),d2)) || signbitf(FN##f(fabsf(f1),f2)) \
+ || signbitl(FN##l(fabsl(ld1),ld2)) || signbit(FN(d1,fabs(d2))) \
+ || signbitf(FN##f(f1,fabsf(f2))) || signbitl(FN##l(ld1,fabsl(ld2)))) \
+ link_failure_##FN()
+
+ /* These are nonnegative if the first AND second argument is. */
+#define ARG2TESTand(FN) \
+ extern void link_failure_##FN (void); PROTOTYPE2(FN) \
+ if (signbit(FN(fabs(d1),fabs(d2))) || signbitf(FN##f(fabsf(f1),fabsf(f2))) \
+ || signbitl(FN##l(fabsl(ld1),fabsl(ld2)))) \
+ link_failure_##FN()
+
+ /* These are nonnegative if the first argument is, 2nd arg is int. */
+#define ARG2TEST1_A2INT(FN) \
+ extern void link_failure_##FN (void); PROTOTYPE2TYPE2(FN, int) \
+ if (signbit(FN(fabs(d1),d2)) || signbitf(FN##f(fabsf(f1),f2)) \
+ || signbitl(FN##l(fabsl(ld1),ld2))) \
+ link_failure_##FN()
+
+ /* These are nonnegative if the first argument is, specify 2nd arg. */
+#define ARG2TEST1_A2FPTR(FN) \
+ extern void link_failure_##FN (void); PROTOTYPE2_A2FPTR(FN) \
+ if (signbit(FN(fabs(d1),&d2)) || signbitf(FN##f(fabsf(f1),&f2)) \
+ || signbitl(FN##l(fabsl(ld1),&ld2))) \
+ link_failure_##FN()
+
+ ARG1TEST1 (asinh);
+ ARG1TEST1 (atan);
+ ARG1TEST1 (atanh);
+ ARG1TEST1 (cbrt);
+ ARG1TEST1 (ceil);
+ ARG1TEST1 (erf);
+ ARG1TEST1 (expm1);
+ ARG1TEST1 (floor);
+ ARG1TEST2 (fmod);
+ ARG2TEST1_A2INT (ldexp);
+ ARG1TEST1_RTYPE (__builtin_llceil, long long);
+ ARG1TEST1_RTYPE (__builtin_llfloor, long long);
+ ARG1TEST1_RTYPE (llrint, long long);
+ ARG1TEST1_RTYPE (llround, long long);
+ ARG1TEST1_RTYPE (__builtin_lceil, long);
+ ARG1TEST1_RTYPE (__builtin_lfloor, long);
+ ARG1TEST1_RTYPE (lrint, long);
+ ARG1TEST1_RTYPE (lround, long);
+ /* The modf* functions aren't ever "const" or "pure" even with
+ -ffast-math so they won't be eliminated and yield a link failure. */
+ /* ARG2TEST1_A2FPTR (modf);*/
+ ARG1TEST1 (nearbyint);
+ ARG1TEST2 (pow);
+ ARG1TEST1 (rint);
+ ARG1TEST1 (round);
+ ARG1TEST1_RTYPE (signbit, int);
+ ARG1TEST1 (sinh);
+ ARG1TEST1 (tanh);
+ ARG1TEST1 (trunc);
+
+ ARG2TESTor (fmax);
+ ARG2TESTand (fmin);
+ ARG2TEST2 (copysign);
+
+}
+
+int main (void)
+{
+ return 0;
+}
builtin-nonneg-1.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr17933-1.c
===================================================================
--- pr17933-1.c (nonexistent)
+++ pr17933-1.c (revision 816)
@@ -0,0 +1,14 @@
+/* PR rtl-optimization/17933.
+ Test-case from the ObjC test-suite, execute/class_self-2.m,
+ translated to C from and reduced by Andrew Pinski. */
+
+struct d
+{ int a; };
+void abort(void);
+typedef struct d (*f) (int i);
+f ff(void);
+void test1()
+{
+ f t = ff();
+ t(0);
+}
pr17933-1.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr25718-1.c
===================================================================
--- pr25718-1.c (nonexistent)
+++ pr25718-1.c (revision 816)
@@ -0,0 +1,27 @@
+/* { dg-do run } */
+/* PR 25718: invalid constant operand to the "bound" insn; error at
+ assembly time. We'll make sure the code is correct to: run a few
+ example values. */
+
+extern void exit (int);
+extern void abort (void);
+unsigned __attribute__ ((__noinline__)) foo(unsigned a)
+{
+ unsigned l;
+ l = (a >= (~0u - 512) ? (~0u - 512) : a);
+ return l;
+}
+
+int
+main (void)
+{
+ if (foo ((unsigned) -512) != (unsigned) -513
+ || foo ((unsigned) -514) != (unsigned) -514
+ || foo ((unsigned) -513) != (unsigned) -513
+ || foo ((unsigned) -1) != (unsigned) -513
+ || foo (513) != 513
+ || foo (0) != 0)
+ abort ();
+
+ exit (0);
+}
pr25718-1.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr29119.c
===================================================================
--- pr29119.c (nonexistent)
+++ pr29119.c (revision 816)
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+
+void ldt_add_entry(void)
+{
+ __asm__ ("" :: "m"(({unsigned __v; __v;})));
+}
+
pr29119.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: builtin-ctype-2.c
===================================================================
--- builtin-ctype-2.c (nonexistent)
+++ builtin-ctype-2.c (revision 816)
@@ -0,0 +1,107 @@
+/* Copyright (C) 2004 Free Software Foundation.
+
+ Verify that built-in ctype transformations are done correctly by
+ the compiler.
+
+ Written by Kaveh Ghazi, 2004-04-05. */
+
+/* { dg-do link } */
+
+extern void link_failure_var(void);
+
+void test(int i)
+{
+ /* All of these ctype calls should compile-time evaluate to true. */
+#define TEST_CTYPE_CST_TRUE(FN, VALUE) \
+ extern void link_failure_##FN##_cst_true(void); \
+ extern int FN(int); \
+ if (! FN(VALUE)) \
+ link_failure_##FN##_cst_true()
+
+ /* All of these ctype calls should compile-time evaluate to false. */
+#define TEST_CTYPE_CST_FALSE(FN, VALUE) \
+ extern void link_failure_##FN##_cst_false(void); \
+ extern int FN(int); \
+ if (FN(VALUE)) \
+ link_failure_##FN##_cst_false()
+
+ /* All of these ctype calls should compile-time evaluate to true. */
+#define TEST_TOCTYPE_CST_TRUE(FN, VALUE) \
+ extern void link_failure_##FN##_cst_true(void); \
+ extern int FN(int); \
+ if (FN(VALUE) != (VALUE)) \
+ link_failure_##FN##_cst_true()
+
+ /* All of these ctype calls should compile-time evaluate to false. */
+#define TEST_TOCTYPE_CST_FALSE(FN, VALUE) \
+ extern void link_failure_##FN##_cst_false(void); \
+ extern int FN(int); \
+ if (FN(VALUE) == (VALUE)) \
+ link_failure_##FN##_cst_false()
+
+#ifdef __OPTIMIZE__
+ TEST_CTYPE_CST_TRUE (isascii, 0);
+ TEST_CTYPE_CST_TRUE (isascii, 1);
+ TEST_CTYPE_CST_TRUE (isascii, 126);
+ TEST_CTYPE_CST_TRUE (isascii, 127);
+
+ TEST_CTYPE_CST_FALSE (isascii, -1);
+ TEST_CTYPE_CST_FALSE (isascii, 128);
+ TEST_CTYPE_CST_FALSE (isascii, 129);
+ TEST_CTYPE_CST_FALSE (isascii, 255);
+ TEST_CTYPE_CST_FALSE (isascii, 256);
+ TEST_CTYPE_CST_FALSE (isascii, 257);
+ TEST_CTYPE_CST_FALSE (isascii, 10000);
+ TEST_CTYPE_CST_FALSE (isascii, __INT_MAX__);
+
+ /* This ctype call should transform into another expression. */
+ if (isascii(i) != ((i & ~0x7f) == 0))
+ link_failure_var();
+
+ TEST_TOCTYPE_CST_TRUE (toascii, 0);
+ TEST_TOCTYPE_CST_TRUE (toascii, 1);
+ TEST_TOCTYPE_CST_TRUE (toascii, 126);
+ TEST_TOCTYPE_CST_TRUE (toascii, 127);
+
+ TEST_TOCTYPE_CST_FALSE (toascii, -1);
+ TEST_TOCTYPE_CST_FALSE (toascii, 128);
+ TEST_TOCTYPE_CST_FALSE (toascii, 129);
+ TEST_TOCTYPE_CST_FALSE (toascii, 255);
+ TEST_TOCTYPE_CST_FALSE (toascii, 256);
+ TEST_TOCTYPE_CST_FALSE (toascii, 10000);
+ TEST_TOCTYPE_CST_FALSE (toascii, __INT_MAX__);
+
+ /* This ctype call should transform into another expression. */
+ if (toascii(i) != (i & 0x7f))
+ link_failure_var();
+
+ TEST_CTYPE_CST_TRUE (isdigit, '0');
+ TEST_CTYPE_CST_TRUE (isdigit, '1');
+ TEST_CTYPE_CST_TRUE (isdigit, '2');
+ TEST_CTYPE_CST_TRUE (isdigit, '3');
+ TEST_CTYPE_CST_TRUE (isdigit, '4');
+ TEST_CTYPE_CST_TRUE (isdigit, '5');
+ TEST_CTYPE_CST_TRUE (isdigit, '6');
+ TEST_CTYPE_CST_TRUE (isdigit, '7');
+ TEST_CTYPE_CST_TRUE (isdigit, '8');
+ TEST_CTYPE_CST_TRUE (isdigit, '9');
+
+ TEST_CTYPE_CST_FALSE (isdigit, '0'-1);
+ TEST_CTYPE_CST_FALSE (isdigit, '9'+1);
+ TEST_CTYPE_CST_FALSE (isdigit, -1);
+ TEST_CTYPE_CST_FALSE (isdigit, 0);
+ TEST_CTYPE_CST_FALSE (isdigit, 255);
+ TEST_CTYPE_CST_FALSE (isdigit, 256);
+ TEST_CTYPE_CST_FALSE (isdigit, 10000);
+ TEST_CTYPE_CST_FALSE (isdigit, __INT_MAX__);
+
+ /* This ctype call should transform into another expression. */
+ if (isdigit(i) != ((unsigned)i - '0' <= 9))
+ link_failure_var();
+#endif /* __OPTIMIZE__ */
+}
+
+int main (void)
+{
+ return 0;
+}
builtin-ctype-2.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr18582-1.c
===================================================================
--- pr18582-1.c (nonexistent)
+++ pr18582-1.c (revision 816)
@@ -0,0 +1,24 @@
+/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
+/* { dg-options "-msse3" } */
+typedef char v16qi __attribute__((vector_size (16)));
+typedef float v4sf __attribute__((vector_size (16)));
+typedef double v2df __attribute__((vector_size (16)));
+
+extern char ca[];
+extern float fa[];
+extern double da[];
+
+extern v16qi cva[];
+extern v4sf fva[];
+extern v2df dva[];
+
+void
+foo (void)
+{
+ cva[0] = __builtin_ia32_loaddqu (ca);
+ cva[0] = __builtin_ia32_lddqu (ca);
+
+ fva[0] = __builtin_ia32_loadups (fa);
+
+ dva[0] = __builtin_ia32_loadupd (da);
+}
pr18582-1.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr26763-1.c
===================================================================
--- pr26763-1.c (nonexistent)
+++ pr26763-1.c (revision 816)
@@ -0,0 +1,18 @@
+/* { dg-do run } */
+
+extern void abort(void);
+
+int try (int *a)
+{
+ return a + -1 > a;
+}
+
+int main(void)
+{
+ int bla[100];
+
+ if (try (bla + 50))
+ abort ();
+
+ return 0;
+}
pr26763-1.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: fp-int-convert-float128-timode.c
===================================================================
--- fp-int-convert-float128-timode.c (nonexistent)
+++ fp-int-convert-float128-timode.c (revision 816)
@@ -0,0 +1,17 @@
+/* Test floating-point conversions. __float128 type with TImode. */
+/* Origin: Joseph Myers */
+/* { dg-do run { target { ia64-*-* || { { i?86-*-* x86_64-*-*} && lp64 } } } } */
+/* { dg-xfail-if "" { i?86-*-* x86_64-*-* } { "*" } { "" } } */
+/* { dg-xfail-if "" { ia64-*-* && lp64 } { "*" } { "" } } */
+/* { dg-options "" } */
+
+#include "fp-int-convert.h"
+
+#define FLOAT128_MANT_DIG 113
+
+int
+main (void)
+{
+ TEST_I_F(TItype, UTItype, __float128, FLOAT128_MANT_DIG);
+ exit (0);
+}
fp-int-convert-float128-timode.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr26565.c
===================================================================
--- pr26565.c (nonexistent)
+++ pr26565.c (revision 816)
@@ -0,0 +1,30 @@
+/* { dg-do run } */
+/* m32c is already packed. */
+/* { dg-skip-if "" { "m32c-*-*" } { "*" } { "" } } */
+
+void *memcpy(void *dest, const void *src, __SIZE_TYPE__ n);
+
+struct timeval {
+ long tv_sec;
+};
+
+struct outdata {
+ long align;
+ char seq;
+ struct timeval tv __attribute__((packed));
+};
+
+void send_probe(struct outdata *outdata, struct timeval *tp) __attribute__((noinline));
+void send_probe(struct outdata *outdata, struct timeval *tp)
+{
+ memcpy(&outdata->tv, tp, sizeof outdata->tv);
+}
+
+struct timeval t;
+struct outdata outdata;
+
+int main()
+{
+ send_probe(&outdata, &t);
+ return 0;
+}
pr26565.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: builtin-noret-2.c
===================================================================
--- builtin-noret-2.c (nonexistent)
+++ builtin-noret-2.c (revision 816)
@@ -0,0 +1,89 @@
+/* Test for builtin noreturn attributes when the visible declarations
+ are function-local. Modified from builtin-noret-1.c by Zack Weinberg
+ . */
+/* { dg-options "-multiply_defined suppress" { target powerpc-*-darwin* } } */
+/* { dg-do link } */
+/* { dg-require-weak "" } */
+
+extern void tabort (void);
+extern void texit (void);
+extern void t_exit (void);
+extern void t_Exit (void);
+
+extern void link_failure (void);
+
+int
+main (void)
+{
+ volatile int i = 0;
+ extern void exit (int);
+ if (i)
+ tabort ();
+ if (i)
+ texit ();
+ if (i)
+ t_exit ();
+ if (i)
+ t_Exit ();
+ exit (0);
+}
+
+void
+tabort (void)
+{
+ extern void abort (void);
+ abort ();
+ link_failure ();
+}
+
+void
+texit (void)
+{
+ extern void exit (int);
+ exit (1);
+ link_failure ();
+}
+
+void
+t_exit (void)
+{
+ extern void _exit (int);
+ /* Some non-Unix libcs have _exit, and won't allow it to be re-defined,
+ so make it weak. */
+#pragma weak _exit
+ _exit (1);
+ link_failure ();
+}
+
+/* Some non-Unix libcs might not have _exit. */
+/* Some non-Unix libcs have _exit, and won't allow it to be re-defined,
+ so make it weak. */
+#pragma weak _exit
+void
+_exit (int i)
+{
+ extern void abort (void);
+ abort ();
+}
+
+void
+t_Exit (void)
+{
+ extern void _Exit (int);
+ /* Some libcs have _Exit, and won't allow it to be re-defined,
+ so make it weak. */
+#pragma weak _Exit
+ _Exit (1);
+ link_failure ();
+}
+
+/* Some libcs might not have _Exit. */
+/* Some libcs have _Exit, and won't allow it to be re-defined,
+ so make it weak. */
+#pragma weak _Exit
+void
+_Exit (int i)
+{
+ extern void abort (void);
+ abort ();
+}
builtin-noret-2.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr28268.c
===================================================================
--- pr28268.c (nonexistent)
+++ pr28268.c (revision 816)
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+
+int __attribute__((vector_size(8))) a;
+
+void foo()
+{
+ a += a*a;
+}
pr28268.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr27773.c
===================================================================
--- pr27773.c (nonexistent)
+++ pr27773.c (revision 816)
@@ -0,0 +1,6 @@
+/* { dg-do compile } */
+
+_Complex float f(_Complex float a, float b)
+{
+ return a - a*b;
+}
pr27773.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: builtin-power-1.c
===================================================================
--- builtin-power-1.c (nonexistent)
+++ builtin-power-1.c (revision 816)
@@ -0,0 +1,114 @@
+/* Copyright (C) 2004 Free Software Foundation.
+
+ Verify that built-in folding of various math "power" functions is
+ correctly performed by the compiler.
+
+ Written by Kaveh Ghazi, 2004-03-11. */
+
+/* { dg-do link } */
+/* { dg-options "-ffast-math" } */
+/* { dg-options "-ffast-math -mmacosx-version-min=10.3" { target powerpc-*-darwin* } } */
+/* { dg-options "-ffast-math -std=c99" { target *-*-solaris2* } } */
+
+#include "../builtins-config.h"
+
+#ifdef HAVE_C99_RUNTIME
+#define C99CODE(CODE) CODE
+#else
+#define C99CODE(CODE) 0
+#endif
+
+#define PROTOTYPE(FN) extern double FN(double); extern float FN##f(float); \
+ extern long double FN##l(long double);
+#define PROTOTYPE2(FN) extern double FN(double, double); \
+ extern float FN##f(float, float); \
+ extern long double FN##l(long double, long double);
+
+PROTOTYPE(fabs)
+PROTOTYPE(sqrt)
+PROTOTYPE(cbrt)
+PROTOTYPE2(pow)
+
+void test(double d1, double d2, double d3,
+ float f1, float f2, float f3,
+ long double ld1, long double ld2, long double ld3)
+{
+ /* Test N1root(N2root(x)) -> pow(x,1/(N1*N2)). */
+ /* E.g. sqrt(cbrt(x)) -> pow(x,1/6). */
+ /* The `ABS' argument is `fabs' when the transformation only works
+ for nonnegative arguments. Otherwise it's blank. */
+#define ROOT_ROOT(FN1,N1,FN2,N2,ABS) \
+ extern void link_failure_##FN1##_##FN2(void); \
+ if (FN1(FN2(ABS(d1))) != pow(ABS(d1),1.0/(N1*N2)) \
+ || C99CODE (FN1##f(FN2##f(ABS(f1))) != powf(ABS(f1),1.0F/(N1*N2))) \
+ || C99CODE (FN1##l(FN2##l(ABS(ld1))) != powl(ABS(ld1),1.0L/(N1*N2)))) \
+ link_failure_##FN1##_##FN2()
+
+ ROOT_ROOT(sqrt,2,sqrt,2,);
+ ROOT_ROOT(sqrt,2,cbrt,3,);
+ ROOT_ROOT(cbrt,3,sqrt,2,);
+ ROOT_ROOT(cbrt,3,cbrt,3,fabs);
+
+ /* Test pow(Nroot(x),y) -> pow(x,y/N). */
+ /* The `ABS' argument is `fabs' when the transformation only works
+ for nonnegative arguments. Otherwise it's blank. */
+#define POW_ROOT(FN,N,ABS) \
+ extern void link_failure_pow_##FN(void); \
+ if (pow(FN(ABS(d1)), d2) != pow(ABS(d1),d2/N) \
+ || powf(FN##f(ABS(f1)),f2) != powf(ABS(f1),f2/N) \
+ || powl(FN##l(ABS(ld1)),ld2) != powl(ABS(ld1),ld2/N)) \
+ link_failure_pow_##FN()
+
+ POW_ROOT(sqrt,2,);
+ POW_ROOT(cbrt,3,fabs);
+
+ /* Test Nroot(pow(x,y)) -> pow(x,y/N). */
+ /* The `ABS' argument is `fabs' when the transformation only works
+ for nonnegative arguments. Otherwise it's blank. */
+#define ROOT_POW(FN,N,ABS) \
+ extern void link_failure_##FN##_pow(void); \
+ if (FN(pow(ABS(d1), d2)) != pow(ABS(d1),d2/N) \
+ || FN##f(powf(ABS(f1),f2)) != powf(ABS(f1),f2/N) \
+ || FN##l(powl(ABS(ld1),ld2)) != powl(ABS(ld1),ld2/N)) \
+ link_failure_##FN##_pow()
+
+ ROOT_POW(sqrt,2,fabs);
+ ROOT_POW(cbrt,3,fabs);
+
+ /* Test pow(pow(x,y),z) -> pow(x,y*z). */
+#define POW_POW \
+ extern void link_failure_pow_pow(void); \
+ if (pow(pow(d1, d2), d3) != pow(d1,d2*d3) \
+ || powf(powf(f1,f2),f3) != powf(f1,f2*f3) \
+ || powl(powl(ld1,ld2),ld3) != powl(ld1,ld2*ld3)) \
+ link_failure_pow_pow()
+
+ POW_POW;
+
+ /* Test Nroot(x)*Nroot(y) -> Nroot(x*y). */
+#define ROOT_X_ROOT(FN) \
+ extern void link_failure_root_x_root(void); \
+ if (FN(d1)*FN(d2) != FN(d1*d2) \
+ || FN##f(f1)*FN##f(f2) != FN##f(f1*f2) \
+ || FN##l(ld1)*FN##l(ld2) != FN##l(ld1*ld2)) \
+ link_failure_root_x_root()
+
+ ROOT_X_ROOT(sqrt);
+ ROOT_X_ROOT(cbrt);
+
+ /* Test pow(x,y)*pow(x,z) -> pow(x,y+z). */
+#define POW_X_POW \
+ extern void link_failure_pow_x_pow(void); \
+ if (pow(d1,d2)*pow(d1,d3) != pow(d1,d2+d3) \
+ || powf(f1,f2)*powf(f1,f3) != powf(f1,f2+f3) \
+ || powl(ld1,ld2)*powl(ld1,ld3) != powl(ld1,ld2+ld3)) \
+ link_failure_pow_x_pow()
+
+ POW_X_POW;
+
+}
+
+int main (void)
+{
+ return 0;
+}
builtin-power-1.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr26869.c
===================================================================
--- pr26869.c (nonexistent)
+++ pr26869.c (revision 816)
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+
+_Complex float f (_Complex float b, _Complex float c)
+{
+ _Complex float a = 1.0 + 0.0i;
+ return a / c;
+}
pr26869.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: asm-subreg-1.c
===================================================================
--- asm-subreg-1.c (nonexistent)
+++ asm-subreg-1.c (revision 816)
@@ -0,0 +1,15 @@
+/* PR middle-end/20491 */
+
+/* { dg-do compile } */
+/* { dg-skip-if "" { hppa*64*-*-* } "*" "" } */
+
+/* Combine used to introduce invalid subregs for the asm input, and
+ we'd crash later on, when removing all subregs. */
+
+volatile unsigned short _const_32 [4] = {1,2,3,4};
+void
+evas_common_convert_yuv_420p_601_rgba()
+{
+ __asm__ __volatile__ ("" : : "X" (*_const_32));
+}
+
asm-subreg-1.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: fp-int-convert-float80-timode.c
===================================================================
--- fp-int-convert-float80-timode.c (nonexistent)
+++ fp-int-convert-float80-timode.c (revision 816)
@@ -0,0 +1,16 @@
+/* Test floating-point conversions. __float80 type with TImode. */
+/* Origin: Joseph Myers */
+/* { dg-do run { target i?86-*-* x86_64-*-* ia64-*-* } } */
+/* { dg-options "" } */
+/* { dg-options "-mmmx" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
+
+#include "fp-int-convert.h"
+
+#define FLOAT80_MANT_DIG 64
+
+int
+main (void)
+{
+ TEST_I_F(TItype, UTItype, __float80, FLOAT80_MANT_DIG);
+ exit (0);
+}
fp-int-convert-float80-timode.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: dg-torture.exp
===================================================================
--- dg-torture.exp (nonexistent)
+++ dg-torture.exp (revision 816)
@@ -0,0 +1,7 @@
+# This harness is for tests that should be run at all optimisation levels.
+
+load_lib gcc-dg.exp
+
+dg-init
+gcc-dg-runtest [lsort [glob $srcdir/$subdir/*.c]] ""
+dg-finish
Index: pr20314-1.c
===================================================================
--- pr20314-1.c (nonexistent)
+++ pr20314-1.c (revision 816)
@@ -0,0 +1,56 @@
+/* PR inline-asm/20314 */
+/* { dg-do compile { target i?86-*-* x86_64-*-* powerpc*-*-* ia64-*-* } } */
+
+int
+f1 (void)
+{
+ int x = 4, y;
+ __asm__ volatile ("" : "+r,r" (x), "=r,r" (y)
+ : "%r,r" (x), "m,r" (8), "r,r" (2));
+ return x;
+}
+
+int
+f2 (void)
+{
+ int x = 4, y;
+ __asm__ volatile ("" : "=r,r" (x), "=r,r" (y)
+ : "%0,0" (x), "m,r" (8), "r,r" (2));
+ return x;
+}
+
+int
+f3 (void)
+{
+ int x = 4, y;
+ __asm__ volatile ("" : "+r,r" (x), "=r,r" (y)
+ : "%m,r" (8), "r,r" (2));
+ return x;
+}
+
+int
+f4 (void)
+{
+ int x = 4, y;
+ __asm__ volatile ("" : "+r" (x), "=r" (y)
+ : "r" (x), "r" (8), "r" (2));
+ return x;
+}
+
+int
+f5 (void)
+{
+ int x = 4, y;
+ __asm__ volatile ("" : "=r" (x), "=r" (y)
+ : "0" (x), "r" (8), "r" (2));
+ return x;
+}
+
+int
+f6 (void)
+{
+ int x = 4, y;
+ __asm__ volatile ("" : "+r" (x), "=r" (y)
+ : "r" (8), "r" (2));
+ return x;
+}
pr20314-1.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr30313.c
===================================================================
--- pr30313.c (nonexistent)
+++ pr30313.c (revision 816)
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+
+static inline void bar(){}
+
+struct S
+{
+ signed int i: 32;
+};
+
+int main()
+{
+ struct S x = {32};
+ sizeof(x.i+0);
+ return 0;
+}
pr30313.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: builtin-wctype-1.c
===================================================================
--- builtin-wctype-1.c (nonexistent)
+++ builtin-wctype-1.c (revision 816)
@@ -0,0 +1,57 @@
+/* Copyright (C) 2004, 2005 Free Software Foundation.
+
+ Verify that built-in wctype function attributes are correctly set
+ by the compiler.
+
+ Written by Kaveh Ghazi, 2004-03-25. */
+
+/* { dg-do link } */
+
+/* Use the target type definitions if we can. */
+#ifndef __WINT_TYPE__
+#define __WINT_TYPE__ int
+#endif
+
+#ifndef __WCHAR_TYPE__
+#define __WCHAR_TYPE__ int
+#endif
+
+void test(int i)
+{
+ /* All of these ctype functions should be const/pure and thus
+ eliminated. */
+#define TEST_IS_WCTYPE(FN) \
+ extern int FN(__WINT_TYPE__); \
+ extern void link_failure_##FN(void); \
+ if (FN(i) != FN(i)) \
+ link_failure_##FN()
+
+#define TEST_TO_WCTYPE(FN) \
+ extern __WINT_TYPE__ FN(__WINT_TYPE__); \
+ extern void link_failure_##FN(void); \
+ if (FN(i) != FN(i)) \
+ link_failure_##FN()
+
+
+#ifdef __OPTIMIZE__
+ TEST_IS_WCTYPE(iswalnum);
+ TEST_IS_WCTYPE(iswalpha);
+ TEST_IS_WCTYPE(iswblank);
+ TEST_IS_WCTYPE(iswcntrl);
+ TEST_IS_WCTYPE(iswdigit);
+ TEST_IS_WCTYPE(iswgraph);
+ TEST_IS_WCTYPE(iswlower);
+ TEST_IS_WCTYPE(iswprint);
+ TEST_IS_WCTYPE(iswpunct);
+ TEST_IS_WCTYPE(iswspace);
+ TEST_IS_WCTYPE(iswupper);
+ TEST_IS_WCTYPE(iswxdigit);
+ TEST_TO_WCTYPE(towlower);
+ TEST_TO_WCTYPE(towupper);
+#endif /* __OPTIMIZE__ */
+}
+
+int main (void)
+{
+ return 0;
+}
builtin-wctype-1.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr23424-1.c
===================================================================
--- pr23424-1.c (nonexistent)
+++ pr23424-1.c (revision 816)
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+extern char *x;
+extern void foo (void);
+void f (char *s, char *se, char *mp, char *y)
+{
+ while (s != se)
+ {
+ char *p;
+ foo ();
+ p = s + *mp;
+ *y++ = *p;
+ s = p;
+ }
+
+ x = s;
+}
pr23424-1.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr27302.c
===================================================================
--- pr27302.c (nonexistent)
+++ pr27302.c (revision 816)
@@ -0,0 +1,15 @@
+/* { dg-do run } */
+
+extern void link_error (void);
+
+void test0 (int a, int b)
+{
+ if ((a < b) != (b > a))
+ link_error ();
+}
+
+int main()
+{
+ test0 (1, 2);
+ return 0;
+}
pr27302.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr24750-1.c
===================================================================
--- pr24750-1.c (nonexistent)
+++ pr24750-1.c (revision 816)
@@ -0,0 +1,72 @@
+extern int unknown;
+extern int n0;
+extern short *s0;
+extern int n1;
+extern short *s1;
+extern short *s2;
+extern int *n2;
+extern int *n3;
+extern int n4;
+extern short *n5;
+extern int *n6;
+extern int n7;
+extern char *unc;
+
+void
+f (short *sp)
+{
+ int j = 0;
+ int i = 0;
+ int n8 = 0;
+ int n9 = 0;
+ short *s3 = sp;
+ short s4 = (short) unknown;
+ short s5 = (short) unknown;
+ char *c0 = unc;
+ int n10 = 0;
+ int n11 = 0;
+ int u0 = unknown;
+ int k = 0;
+
+ for (n8 = 1; n8 <= n7; n8++)
+ {
+ for (i = 1; i <= n0; i++)
+ c0[i] = 0;
+ for (i = 1; i <= u0; i++) { }
+ for (i = sp[0]; i != -32767; i = sp[i])
+ if (s4 == u0)
+ for (j = 1; j <= u0; j++)
+ if (!c0[s3[j]])
+ break;
+ }
+ for (n9 = 1; n9 <= n0; n9++) s1[unknown + n9] = n9;
+ for (i = 1; i <= n1; i++)
+ for (j = 1; j <= s4; j++)
+ s3[j] = s1[s3[j]];
+ for (n8 = 1; n8 <= n7; n8++)
+ for (i = 1; i <= s5; i++)
+ s3[i] = s1[s3[i]];
+ for (n9 = 1; n9 <= n0; n9++) sp[s1[n9]] = unknown;
+ for (n10 = 2; n10 < n4; n10++) { }
+ for (k = 1; k <= unknown; k++)
+ {
+ s4 = s0[n5[u0]];
+ for (i = 1; i <= s4; i++) { }
+ for (j = 1; j <= s4; j++)
+ if (n2[1] != 0)
+ if (i == unknown)
+ unknown = n3[unknown];
+ n6[u0] = n10;
+ }
+ for (k = n7; k >= n11; k--)
+ if (n2[k] == -32767)
+ break;
+ free (c0);
+
+ for (i = 1; i <= n7; i++)
+ {
+ for (j = 1; j <= s4; j++) { }
+ for (n8 = s2[unknown]; n8 != -32767; n8 = s2[n8]) { }
+ for (j = 1; j <= s5; j++) { }
+ }
+}
pr24750-1.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr24912-1.c
===================================================================
--- pr24912-1.c (nonexistent)
+++ pr24912-1.c (revision 816)
@@ -0,0 +1,10 @@
+void foo(void);
+void
+bar (unsigned char *p)
+{
+ int j;
+ j = *(p) ;
+ j += ((signed char) (*p) ) << 8;
+ if (j)
+ foo();
+}
pr24912-1.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr26630.c
===================================================================
--- pr26630.c (nonexistent)
+++ pr26630.c (revision 816)
@@ -0,0 +1,12 @@
+/* { dg-do run } */
+/* { dg-require-effective-target int32plus } */
+
+extern void abort(void);
+int main()
+{
+ int a1 = 40000;
+ int c1 = ( ((int)(short)(a1-10000)) + 10000)*2;
+ if (c1 != 80000)
+ abort();
+ return 0;
+}
pr26630.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: badshift.c
===================================================================
--- badshift.c (nonexistent)
+++ badshift.c (revision 816)
@@ -0,0 +1,29 @@
+/* PR rtl-optimization/20532 */
+
+/* { dg-do run } */
+/* { dg-options "" } */
+/* { dg-options "-march=i386" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
+
+/* We used to optimize the DImode shift-by-32 to zero because in combine
+ we turned:
+
+ (v << 31) + (v << 31)
+
+ into:
+
+ (v * (((HOST_WIDE_INT)1 << 31) + ((HOST_WIDE_INT)1 << 31)))
+
+ With a 32-bit HOST_WIDE_INT, the coefficient overflowed to zero. */
+
+unsigned long long int badshift(unsigned long long int v)
+{
+ return v << 31 << 1;
+}
+
+extern void abort ();
+
+int main() {
+ if (badshift (1) == 0)
+ abort ();
+ return 0;
+}
badshift.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr25183.c
===================================================================
--- pr25183.c (nonexistent)
+++ pr25183.c (revision 816)
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-pedantic" } */
+
+enum err {
+ err_IO = 0x8a450000, /* { dg-warning "int" } */
+ err_NM,
+ err_EOF,
+ err_SE,
+ err_PT
+};
+static enum err E_;
+int error()
+{
+ switch (E_) {
+ case err_IO : break; /* { dg-warning "overflow" } */
+ case err_NM : break; /* { dg-warning "overflow" } */
+ case err_EOF : break; /* { dg-warning "overflow" } */
+ case err_SE : break; /* { dg-warning "overflow" } */
+ case err_PT : break; /* { dg-warning "overflow" } */
+ default : return 0;
+ }
+}
pr25183.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr25481.c
===================================================================
--- pr25481.c (nonexistent)
+++ pr25481.c (revision 816)
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+
+struct s {
+ int *blah;
+};
+
+static struct s array[] = {
+ { 0 }
+};
+
+void
+foo (struct s *p)
+{
+ unsigned int n = 1;
+ struct s *q = &array[n];
+ while (p < q)
+ p++;
+}
pr25481.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: fp-int-convert-float80.c
===================================================================
--- fp-int-convert-float80.c (nonexistent)
+++ fp-int-convert-float80.c (revision 816)
@@ -0,0 +1,20 @@
+/* Test floating-point conversions. __float80 type. */
+/* Origin: Joseph Myers */
+/* { dg-do run { target i?86-*-* x86_64-*-* ia64-*-* } } */
+/* { dg-options "" } */
+/* { dg-options "-mmmx" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
+
+#include "fp-int-convert.h"
+
+#define FLOAT80_MANT_DIG 64
+
+int
+main (void)
+{
+ TEST_I_F(signed char, unsigned char, __float80, FLOAT80_MANT_DIG);
+ TEST_I_F(signed short, unsigned short, __float80, FLOAT80_MANT_DIG);
+ TEST_I_F(signed int, unsigned int, __float80, FLOAT80_MANT_DIG);
+ TEST_I_F(signed long, unsigned long, __float80, FLOAT80_MANT_DIG);
+ TEST_I_F(signed long long, unsigned long long, __float80, FLOAT80_MANT_DIG);
+ exit (0);
+}
fp-int-convert-float80.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr27184.c
===================================================================
--- pr27184.c (nonexistent)
+++ pr27184.c (revision 816)
@@ -0,0 +1,22 @@
+/* Copyright 2006 Free Software Foundation */
+
+/* Make sure a and a1 alias each other.
+ Incomplete array types used to not be unified, which broke aliasing. */
+
+/* { dg-do run } */
+
+typedef long atype[];
+typedef long atype1[];
+int NumSift (atype *a, atype1 *a1)
+{
+ (*a)[0] = 0;
+ (*a1)[0] = 1;
+ return (*a)[0];
+}
+int main(void)
+{
+ long a[2];
+ if (!NumSift(&a, &a))
+ __builtin_abort ();
+ return 0;
+}
pr27184.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr26672.c
===================================================================
--- pr26672.c (nonexistent)
+++ pr26672.c (revision 816)
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+
+int printf(const char *format, ...);
+extern const char help_string[];
+void app_opts(void) {
+ printf("%s", help_string);
+}
+const char help_string[] = "foo\n";
pr26672.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr28814.c
===================================================================
--- pr28814.c (nonexistent)
+++ pr28814.c (revision 816)
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+
+struct w49
+{
+ union
+ {
+ }
+ value;
+};
+f9887 (struct w49 a23040)
+{
+ unsigned long r9887;
+ if (((struct structure_type24753 *) (r9887 - 1)) == ((void *) 0))
+ {
+ backtrace ("stalin.sc", 7222, 248274);
+ }
+}
pr28814.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr19683-1.c
===================================================================
--- pr19683-1.c (nonexistent)
+++ pr19683-1.c (revision 816)
@@ -0,0 +1,50 @@
+/* From PR rtl-optimization/19683. On little-endian MIPS targets,
+ reload would incorrectly inherit the high part of the multiplication
+ result. */
+/* { dg-do run { target mips*-*-* } } */
+
+extern void abort (void);
+extern void exit (int);
+
+#ifndef __mips16
+#define REPEAT10(X, Y) \
+ X(Y##0); X(Y##1); X(Y##2); X(Y##3); X(Y##4); \
+ X(Y##5); X(Y##6); X(Y##7); X(Y##8); X(Y##9)
+
+#define REPEAT30(X) REPEAT10 (X, 0); REPEAT10 (X, 1); REPEAT10 (X, 2)
+#define IN(X) unsigned int x##X = ptr[0]
+#define OUT(X) ptr[0] = x##X
+
+union u { unsigned long long ll; unsigned int i[2]; };
+
+unsigned int
+foo (volatile unsigned int *ptr)
+{
+ union u u;
+ int result;
+
+ u.ll = (unsigned long long) ptr[0] * ptr[0];
+ REPEAT30 (IN);
+ REPEAT30 (OUT);
+ asm ("#" : "=l" (result) : "l" (u.i[1]));
+ return result;
+}
+
+int
+main (void)
+{
+ unsigned int array[] = { 1000 * 1000 * 1000 };
+ union u u;
+
+ u.ll = (unsigned long long) array[0] * array[0];
+ if (foo (array) != u.i[1])
+ abort ();
+ exit (0);
+}
+#else
+int
+main (void)
+{
+ exit (0);
+}
+#endif
pr19683-1.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: builtin-math-1.c
===================================================================
--- builtin-math-1.c (nonexistent)
+++ builtin-math-1.c (revision 816)
@@ -0,0 +1,186 @@
+/* Copyright (C) 2002, 2003, 2004 Free Software Foundation.
+
+ Verify that built-in math function constant folding of constant
+ arguments is correctly performed by the compiler.
+
+ Written by Roger Sayle, 16th August 2002. */
+
+/* { dg-do link } */
+
+extern double atan (double);
+extern float atanf (float);
+extern long double atanl (long double);
+extern double cbrt (double);
+extern float cbrtf (float);
+extern long double cbrtl (long double);
+extern double cos (double);
+extern float cosf (float);
+extern long double cosl (long double);
+extern double exp (double);
+extern float expf (float);
+extern long double expl (long double);
+extern double log (double);
+extern float logf (float);
+extern long double logl (long double);
+extern double pow (double, double);
+extern float powf (float, float);
+extern long double powl (long double, long double);
+extern double sin (double);
+extern float sinf (float);
+extern long double sinl (long double);
+extern double sqrt (double);
+extern float sqrtf (float);
+extern long double sqrtl (long double);
+extern double tan (double);
+extern float tanf (float);
+extern long double tanl (long double);
+
+/* All references to link_error should go away at compile-time. */
+extern void link_error(void);
+
+void test (float f, double d, long double ld)
+{
+ if (sqrt (0.0) != 0.0)
+ link_error ();
+
+ if (sqrt (1.0) != 1.0)
+ link_error ();
+
+ if (cbrt (0.0) != 0.0)
+ link_error ();
+
+ if (cbrt (1.0) != 1.0)
+ link_error ();
+
+ if (cbrt (-1.0) != -1.0)
+ link_error ();
+
+ if (exp (0.0) != 1.0)
+ link_error ();
+
+ if (exp (1.0) <= 2.71 || exp (1.0) >= 2.72)
+ link_error ();
+
+ if (log (1.0) != 0.0)
+ link_error ();
+
+ if (sin (0.0) != 0.0)
+ link_error ();
+
+ if (cos (0.0) != 1.0)
+ link_error ();
+
+ if (tan (0.0) != 0.0)
+ link_error ();
+
+ if (atan (0.0) != 0.0)
+ link_error ();
+
+ if (4.0*atan (1.0) <= 3.14 || 4.0*atan (1.0) >= 3.15)
+ link_error ();
+
+ if (pow (d, 0.0) != 1.0)
+ link_error ();
+
+ if (pow (1.0, d) != 1.0)
+ link_error ();
+
+
+ if (sqrtf (0.0F) != 0.0F)
+ link_error ();
+
+ if (sqrtf (1.0F) != 1.0F)
+ link_error ();
+
+ if (cbrtf (0.0F) != 0.0F)
+ link_error ();
+
+ if (cbrtf (1.0F) != 1.0F)
+ link_error ();
+
+ if (cbrtf (-1.0F) != -1.0F)
+ link_error ();
+
+ if (expf (0.0F) != 1.0F)
+ link_error ();
+
+ if (expf (1.0F) <= 2.71F || expf (1.0F) >= 2.72F)
+ link_error ();
+
+ if (logf (1.0F) != 0.0F)
+ link_error ();
+
+ if (sinf (0.0F) != 0.0F)
+ link_error ();
+
+ if (cosf (0.0F) != 1.0F)
+ link_error ();
+
+ if (tanf (0.0F) != 0.0F)
+ link_error ();
+
+ if (atanf (0.0F) != 0.0F)
+ link_error ();
+
+ if (4.0F*atanf (1.0F) <= 3.14F || 4.0F*atanf (1.0F) >= 3.15F)
+ link_error ();
+
+ if (powf (f, 0.0F) != 1.0F)
+ link_error ();
+
+ if (powf (1.0F, f) != 1.0F)
+ link_error ();
+
+
+ if (sqrtl (0.0L) != 0.0L)
+ link_error ();
+
+ if (sqrtl (1.0L) != 1.0L)
+ link_error ();
+
+ if (cbrtl (0.0L) != 0.0L)
+ link_error ();
+
+ if (cbrtl (1.0L) != 1.0L)
+ link_error ();
+
+ if (cbrtl (-1.0L) != -1.0L)
+ link_error ();
+
+ if (expl (0.0L) != 1.0L)
+ link_error ();
+
+ if (expl (1.0L) <= 2.71L || expl (1.0L) >= 2.72L)
+ link_error ();
+
+ if (logl (1.0L) != 0.0L)
+ link_error ();
+
+ if (sinl (0.0L) != 0.0L)
+ link_error ();
+
+ if (cosl (0.0L) != 1.0L)
+ link_error ();
+
+ if (tanl (0.0L) != 0.0L)
+ link_error ();
+
+ if (atanl (0.0) != 0.0L)
+ link_error ();
+
+ if (4.0L*atanl (1.0L) <= 3.14L || 4.0L*atanl (1.0L) >= 3.15L)
+ link_error ();
+
+ if (powl (ld, 0.0L) != 1.0L)
+ link_error ();
+
+ if (powl (1.0L, ld) != 1.0L)
+ link_error ();
+}
+
+int main()
+{
+ test (3.0, 3.0F, 3.0L);
+
+ return 0;
+}
builtin-math-1.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: mips-hilo-1.c
===================================================================
--- mips-hilo-1.c (nonexistent)
+++ mips-hilo-1.c (revision 816)
@@ -0,0 +1,78 @@
+/* f1 checks that an mtlo is not moved before an mfhi. f2 does the same
+ for an mthi and an mflo. */
+/* { dg-do run { target mips*-*-* } } */
+/* { dg-options "-mtune=rm7000" } */
+
+extern void abort (void);
+extern void exit (int);
+
+#if !defined(__mips16)
+
+#define DECLARE(TYPE) \
+ TYPE __attribute__ ((noinline)) \
+ f1##TYPE (TYPE x1, TYPE x2, TYPE x3) \
+ { \
+ TYPE t1, t2; \
+ \
+ asm ("mult\t%1,%2" : "=h" (t1) : "d" (x1), "d" (x2) : "lo"); \
+ asm ("mflo\t%0" : "=r" (t2) : "l" (x3) : "hi"); \
+ return t1 + t2; \
+ } \
+ \
+ TYPE __attribute__ ((noinline)) \
+ f2##TYPE (TYPE x1, TYPE x2, TYPE x3) \
+ { \
+ TYPE t1, t2; \
+ \
+ asm ("mult\t%1,%2" : "=l" (t1) : "d" (x1), "d" (x2) : "hi"); \
+ asm ("mfhi\t%0" : "=r" (t2) : "h" (x3) : "lo"); \
+ return t1 + t2; \
+ }
+
+#define TEST(TYPE) \
+ if (f1##TYPE (1, 2, 10) != 10) \
+ abort (); \
+ if (f2##TYPE (1, 2, 40) != 42) \
+ abort ()
+
+typedef char c;
+typedef signed char sc;
+typedef unsigned char uc;
+typedef short s;
+typedef unsigned short us;
+typedef int i;
+typedef unsigned int ui;
+typedef long long ll;
+typedef unsigned long long ull;
+
+DECLARE (c)
+DECLARE (sc)
+DECLARE (uc)
+DECLARE (s)
+DECLARE (us)
+DECLARE (i)
+DECLARE (ui)
+#if defined (__mips64)
+DECLARE (ll)
+DECLARE (ull)
+#endif
+
+int
+main ()
+{
+ TEST (c);
+ TEST (sc);
+ TEST (uc);
+ TEST (s);
+ TEST (us);
+ TEST (i);
+ TEST (ui);
+#if defined (__mips64)
+ TEST (ll);
+ TEST (ull);
+#endif
+ exit (0);
+}
+#else
+int main () { exit (0); }
+#endif
mips-hilo-1.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr16104-1.c
===================================================================
--- pr16104-1.c (nonexistent)
+++ pr16104-1.c (revision 816)
@@ -0,0 +1,88 @@
+/* PR rtl-optimization/16104 */
+/* { dg-do run { target i?86-*-* x86_64-*-* } } */
+/* { dg-options "-msse2" } */
+
+#include "../i386-cpuid.h"
+
+extern void abort (void);
+
+typedef int V2SI __attribute__ ((vector_size (8)));
+typedef unsigned int V2USI __attribute__ ((vector_size (8)));
+typedef short V2HI __attribute__ ((vector_size (4)));
+typedef unsigned int V2UHI __attribute__ ((vector_size (4)));
+
+int
+test1 (void)
+{
+ return (long long) (V2SI) 0LL;
+}
+
+int
+test2 (V2SI x)
+{
+ return (long long) x;
+}
+
+V2SI
+test3 (void)
+{
+ return (V2SI) (long long) (int) (V2HI) 0;
+}
+
+V2SI
+test4 (V2HI x)
+{
+ return (V2SI) (long long) (int) x;
+}
+
+V2SI
+test5 (V2USI x)
+{
+ return (V2SI) x;
+}
+
+int
+__attribute__ ((noinline))
+do_test (void)
+{
+ if (sizeof (short) != 2 || sizeof (int) != 4 || sizeof (long long) != 8)
+ return 0;
+
+ if (test1 () != 0)
+ abort ();
+
+ V2SI x = { 2, 2 };
+ if (test2 (x) != 2)
+ abort ();
+
+ union { V2SI x; int y[2]; V2USI z; long long l; } u;
+ u.x = test3 ();
+ if (u.y[0] != 0 || u.y[1] != 0)
+ abort ();
+
+ V2HI y = { 4, 4 };
+ union { V2SI x; long long y; } v;
+ v.x = test4 (y);
+ if (v.y != 0x40004)
+ abort ();
+
+ V2USI z = { 6, 6 };
+ u.x = test5 (z);
+ if (u.y[0] != 6 || u.y[1] != 6)
+ abort ();
+ return 0;
+}
+
+int
+main (void)
+{
+ unsigned long cpu_facilities;
+
+ cpu_facilities = i386_cpuid ();
+
+ if ((cpu_facilities & (bit_MMX | bit_SSE | bit_CMOV | bit_SSE2))
+ != (bit_MMX | bit_SSE | bit_CMOV | bit_SSE2))
+ return 0;
+
+ return do_test ();
+}
pr16104-1.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr30364-1.c
===================================================================
--- pr30364-1.c (nonexistent)
+++ pr30364-1.c (revision 816)
@@ -0,0 +1,19 @@
+/* { dg-do run } */
+
+extern void abort (void);
+
+int f(int a, int b)
+{
+ if (a > 0x7FFFFFF0) return 0;
+ if (b > 0x7FFFFFF0) return 0;
+
+ int c = (a - 20) + (b - 20);
+ return c > 0x7FFFFFF0;
+}
+
+int main()
+{
+ if (f (0x7FFFFFF0, 41) != 1)
+ abort ();
+ return 0;
+}
pr30364-1.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: fp-int-convert-long-double.c
===================================================================
--- fp-int-convert-long-double.c (nonexistent)
+++ fp-int-convert-long-double.c (revision 816)
@@ -0,0 +1,18 @@
+/* Test floating-point conversions. Standard types and long double. */
+/* Origin: Joseph Myers */
+/* { dg-do run } */
+/* { dg-options "" } */
+
+#include
+#include "fp-int-convert.h"
+
+int
+main (void)
+{
+ TEST_I_F(signed char, unsigned char, long double, LDBL_MANT_DIG);
+ TEST_I_F(signed short, unsigned short, long double, LDBL_MANT_DIG);
+ TEST_I_F(signed int, unsigned int, long double, LDBL_MANT_DIG);
+ TEST_I_F(signed long, unsigned long, long double, LDBL_MANT_DIG);
+ TEST_I_F(signed long long, unsigned long long, long double, LDBL_MANT_DIG);
+ exit (0);
+}
fp-int-convert-long-double.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: mips-clobber-at.c
===================================================================
--- mips-clobber-at.c (nonexistent)
+++ mips-clobber-at.c (revision 816)
@@ -0,0 +1,4 @@
+/* "$1" used to be mapped to the internal frame pointer. */
+/* { dg-do compile { target mips*-*-* } } */
+/* { dg-options "" } */
+int foo () { asm volatile ("#" ::: "$1"); }
mips-clobber-at.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: nested-fn-1.c
===================================================================
--- nested-fn-1.c (nonexistent)
+++ nested-fn-1.c (revision 816)
@@ -0,0 +1,73 @@
+/* PR middle-end/15345, c/16450 */
+/* Test whether unused nested functions aren't emitted into the assembly. */
+/* { dg-do compile } */
+/* { dg-options "-g0" } */
+
+int
+fn1 (int x)
+{
+ int i = x;
+ inline __attribute__((always_inline)) int
+ should_not_appear1 (void)
+ {
+ return i;
+ }
+ return should_not_appear1 ();
+}
+
+int
+fn2 (int x)
+{
+ int i = x;
+ inline __attribute__((always_inline)) int
+ should_not_appear2 (void)
+ {
+ return i;
+ }
+ return x;
+}
+
+extern void check (void *p);
+
+int
+fn3 (int x)
+{
+ int i = x;
+ inline int
+ should_appear1 (void)
+ {
+ char *p = __builtin_alloca (i);
+ check (p);
+ return i;
+ }
+ return should_appear1 ();
+}
+
+int
+fn4 (int x)
+{
+ int i = x;
+ inline int
+ should_not_appear3 (void)
+ {
+ char *p = __builtin_alloca (i);
+ check (p);
+ return i;
+ }
+ return 0 ? should_not_appear3 () : 1;
+}
+
+int
+fn5 (int x)
+{
+ int i = x;
+ inline int
+ should_appear2 (void)
+ {
+ return i;
+ }
+ check (should_appear2);
+ return i;
+}
+
+/* { dg-final { scan-assembler-not "should_not_appear" } } */
nested-fn-1.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr30364-3.c
===================================================================
--- pr30364-3.c (nonexistent)
+++ pr30364-3.c (revision 816)
@@ -0,0 +1,20 @@
+/* { dg-do run } */
+/* { dg-options "-fwrapv" } */
+
+extern void abort (void);
+
+int f(int a, int b)
+{
+ if (a > 0x7FFFFFF0) return 0;
+ if (b > 0x7FFFFFF0) return 0;
+
+ int c = (a - 20) + (b - 20);
+ return c > 0x7FFFFFF0;
+}
+
+int main()
+{
+ if (f (0x7FFFFFF0, 41) != 1)
+ abort ();
+ return 0;
+}
pr30364-3.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr21817-1.c
===================================================================
--- pr21817-1.c (nonexistent)
+++ pr21817-1.c (revision 816)
@@ -0,0 +1,16 @@
+/* hppa*-*-hpux* needs -fno-common so that value can be given a 16
+ byte alignment. */
+
+/* { dg-do compile } */
+/* { dg-options "-fno-common" { target { hppa*-*-hpux* } } } */
+
+typedef float v4sf __attribute__((vector_size(16)));
+v4sf value;
+void foo(void)
+{
+ unsigned int band;
+ for(band=0; band < 2; band++)
+ {
+ value += (v4sf){1e9f,1e9f,1e9f,1e9f};
+ }
+}
pr21817-1.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: builtin-convert-1.c
===================================================================
--- builtin-convert-1.c (nonexistent)
+++ builtin-convert-1.c (revision 816)
@@ -0,0 +1,150 @@
+/* Copyright (C) 2004 Free Software Foundation.
+
+ Verify that built-in math function conversion to smaller FP types
+ is correctly performed by the compiler.
+
+ Written by Kaveh Ghazi, 2004-03-17. */
+
+/* { dg-do link } */
+/* { dg-options "-ffast-math" } */
+/* { dg-options "-ffast-math -mmacosx-version-min=10.3" { target powerpc-*-darwin* } } */
+/* { dg-options "-ffast-math -std=c99" { target *-*-solaris2* } } */
+
+#include "../builtins-config.h"
+
+/* This check is necessary when converting to a C99 function. */
+#ifdef HAVE_C99_RUNTIME
+#define C99CODE(CODE) (CODE)
+#define MAYBEC99(CODE, C99) (CODE)
+#else
+#define C99CODE(CODE) 0
+#define MAYBEC99(CODE, C99) (!(C99) && (CODE))
+#endif
+
+void test(double d1, float f1, long double ld1)
+{
+ /* Test converting math builtins to narrower FP types based on a
+ narrowing cast on the outside of the call. MATHFN is the
+ function to test, and C99 is 0/1 depending on whether the
+ `double' version of MATHFN is a C99 function. The optimization
+ is only performed if the replacement function is actually
+ narrower in width, so check that first. */
+#define OUTER_CAST1(MATHFN, C99) \
+ extern void link_failure_outer_##MATHFN##l_##MATHFN##_1(void); \
+ extern void link_failure_outer_##MATHFN##l_##MATHFN##_2(void); \
+ extern void link_failure_outer_##MATHFN##l_##MATHFN##f_1(void); \
+ extern void link_failure_outer_##MATHFN##l_##MATHFN##f_2(void); \
+ extern void link_failure_outer_##MATHFN##_##MATHFN##f_1(void); \
+ extern void link_failure_outer_##MATHFN##_##MATHFN##f_2(void); \
+ if (sizeof (long double) > sizeof (double) \
+ && MAYBEC99 ((double) __builtin_##MATHFN##l((double)ld1) != __builtin_##MATHFN(ld1), C99)) \
+ link_failure_outer_##MATHFN##l_##MATHFN##_1(); \
+ if (sizeof (long double) > sizeof (double) \
+ && MAYBEC99 ((double) __builtin_##MATHFN##l(d1) != __builtin_##MATHFN(d1), C99)) \
+ link_failure_outer_##MATHFN##l_##MATHFN##_1(); \
+ if (sizeof (long double) > sizeof (double) \
+ && MAYBEC99 ((double) __builtin_##MATHFN##l(f1) != __builtin_##MATHFN(f1), C99)) \
+ link_failure_outer_##MATHFN##l_##MATHFN##_2(); \
+ if (sizeof (long double) > sizeof (float) \
+ && C99CODE ((float) __builtin_##MATHFN##l((float) ld1) != __builtin_##MATHFN##f(ld1))) \
+ link_failure_outer_##MATHFN##l_##MATHFN##f_1(); \
+ if (sizeof (long double) > sizeof (float) \
+ && C99CODE ((float) __builtin_##MATHFN##l((float) d1) != __builtin_##MATHFN##f(d1))) \
+ link_failure_outer_##MATHFN##l_##MATHFN##f_1(); \
+ if (sizeof (long double) > sizeof (float) \
+ && C99CODE ((float) __builtin_##MATHFN##l(f1) != __builtin_##MATHFN##f(f1))) \
+ link_failure_outer_##MATHFN##l_##MATHFN##f_2(); \
+ if (sizeof (double) > sizeof (float) \
+ && C99CODE ((float) __builtin_##MATHFN((float) ld1) != __builtin_##MATHFN##f(ld1))) \
+ link_failure_outer_##MATHFN##_##MATHFN##f_1(); \
+ if (sizeof (double) > sizeof (float) \
+ && C99CODE ((float) __builtin_##MATHFN((float) d1) != __builtin_##MATHFN##f(d1))) \
+ link_failure_outer_##MATHFN##_##MATHFN##f_1(); \
+ if (sizeof (double) > sizeof (float) \
+ && C99CODE ((float) __builtin_##MATHFN(f1) != __builtin_##MATHFN##f(f1))) \
+ link_failure_outer_##MATHFN##_##MATHFN##f_2()
+
+ /* Test converting math builtins to narrower FP types based on if
+ the argument is a narrower type (perhaps implicitly) cast to a
+ wider one. */
+#define INNER_CAST1(MATHFN, C99) \
+ extern void link_failure_inner_##MATHFN##l_##MATHFN(void); \
+ extern void link_failure_inner_##MATHFN##l_##MATHFN##f(void); \
+ extern void link_failure_inner_##MATHFN##_##MATHFN##f(void); \
+ if (sizeof (long double) > sizeof (double) \
+ && MAYBEC99 (__builtin_##MATHFN##l(d1) != (long double) __builtin_##MATHFN(d1), C99)) \
+ link_failure_inner_##MATHFN##l_##MATHFN(); \
+ if (sizeof (long double) > sizeof (float) \
+ && C99CODE (__builtin_##MATHFN##l(f1) != (long double) __builtin_##MATHFN##f(f1))) \
+ link_failure_inner_##MATHFN##l_##MATHFN##f(); \
+ if (sizeof (long double) > sizeof (float) \
+ && C99CODE (__builtin_##MATHFN##l((double)f1) != (long double) __builtin_##MATHFN##f(f1))) \
+ link_failure_inner_##MATHFN##l_##MATHFN##f(); \
+ if (sizeof (double) > sizeof (float) \
+ && C99CODE (__builtin_##MATHFN(f1) != (double) __builtin_##MATHFN##f(f1))) \
+ link_failure_inner_##MATHFN##_##MATHFN##f()
+
+
+#ifdef __OPTIMIZE__
+ OUTER_CAST1 (acos, /*C99=*/ 0);
+ OUTER_CAST1 (acosh, /*C99=*/ 1);
+ OUTER_CAST1 (asin, /*C99=*/ 1);
+ OUTER_CAST1 (asinh, /*C99=*/ 1);
+ OUTER_CAST1 (atan, /*C99=*/ 0);
+ OUTER_CAST1 (atanh, /*C99=*/ 1);
+ OUTER_CAST1 (cbrt, /*C99=*/ 1);
+ OUTER_CAST1 (cos, /*C99=*/ 0);
+ OUTER_CAST1 (cosh, /*C99=*/ 0);
+ OUTER_CAST1 (erf, /*C99=*/ 1);
+ OUTER_CAST1 (erfc, /*C99=*/ 1);
+ OUTER_CAST1 (exp, /*C99=*/ 0);
+ OUTER_CAST1 (exp2, /*C99=*/ 1);
+ OUTER_CAST1 (expm1, /*C99=*/ 1);
+ OUTER_CAST1 (fabs, /*C99=*/ 0);
+ OUTER_CAST1 (log, /*C99=*/ 0);
+ OUTER_CAST1 (log10, /*C99=*/ 0);
+ OUTER_CAST1 (log1p, /*C99=*/ 1);
+ OUTER_CAST1 (log2, /*C99=*/ 1);
+ OUTER_CAST1 (logb, /*C99=*/ 1);
+ OUTER_CAST1 (sin, /*C99=*/ 0);
+ OUTER_CAST1 (sinh, /*C99=*/ 0);
+ OUTER_CAST1 (sqrt, /*C99=*/ 0);
+ OUTER_CAST1 (tan, /*C99=*/ 0);
+ OUTER_CAST1 (tanh, /*C99=*/ 0);
+ OUTER_CAST1 (tgamma, /*C99=*/ 1);
+
+ INNER_CAST1 (ceil, /*C99=*/ 0);
+ OUTER_CAST1 (ceil, /*C99=*/ 0);
+ INNER_CAST1 (floor, /*C99=*/ 0);
+ OUTER_CAST1 (floor, /*C99=*/ 0);
+ INNER_CAST1 (lceil, /*C99=*/ 1);
+ OUTER_CAST1 (lceil, /*C99=*/ 1);
+ INNER_CAST1 (lfloor, /*C99=*/ 1);
+ OUTER_CAST1 (lfloor, /*C99=*/ 1);
+ INNER_CAST1 (lrint, /*C99=*/ 1);
+ OUTER_CAST1 (lrint, /*C99=*/ 1);
+ INNER_CAST1 (lround, /*C99=*/ 1);
+ OUTER_CAST1 (lround, /*C99=*/ 1);
+ INNER_CAST1 (llceil, /*C99=*/ 1);
+ OUTER_CAST1 (llceil, /*C99=*/ 1);
+ INNER_CAST1 (llfloor, /*C99=*/ 1);
+ OUTER_CAST1 (llfloor, /*C99=*/ 1);
+ INNER_CAST1 (llrint, /*C99=*/ 1);
+ OUTER_CAST1 (llrint, /*C99=*/ 1);
+ INNER_CAST1 (llround, /*C99=*/ 1);
+ OUTER_CAST1 (llround, /*C99=*/ 1);
+ INNER_CAST1 (nearbyint, /*C99=*/ 1);
+ OUTER_CAST1 (nearbyint, /*C99=*/ 1);
+ INNER_CAST1 (rint, /*C99=*/ 1);
+ OUTER_CAST1 (rint, /*C99=*/ 1);
+ INNER_CAST1 (round, /*C99=*/ 1);
+ OUTER_CAST1 (round, /*C99=*/ 1);
+ INNER_CAST1 (trunc, /*C99=*/ 1);
+ OUTER_CAST1 (trunc, /*C99=*/ 1);
+#endif /* __OPTIMIZE__ */
+}
+
+int main (void)
+{
+ return 0;
+}
builtin-convert-1.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: fp-int-convert-double.c
===================================================================
--- fp-int-convert-double.c (nonexistent)
+++ fp-int-convert-double.c (revision 816)
@@ -0,0 +1,18 @@
+/* Test floating-point conversions. Standard types and double. */
+/* Origin: Joseph Myers */
+/* { dg-do run } */
+/* { dg-options "" } */
+
+#include
+#include "fp-int-convert.h"
+
+int
+main (void)
+{
+ TEST_I_F(signed char, unsigned char, double, DBL_MANT_DIG);
+ TEST_I_F(signed short, unsigned short, double, DBL_MANT_DIG);
+ TEST_I_F(signed int, unsigned int, double, DBL_MANT_DIG);
+ TEST_I_F(signed long, unsigned long, double, DBL_MANT_DIG);
+ TEST_I_F(signed long long, unsigned long long, double, DBL_MANT_DIG);
+ exit (0);
+}
fp-int-convert-double.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr24626-2.c
===================================================================
--- pr24626-2.c (nonexistent)
+++ pr24626-2.c (revision 816)
@@ -0,0 +1,54 @@
+/* { dg-do compile } */
+
+typedef unsigned int u_int8_t __attribute__ ((__mode__ (__QI__)));
+typedef unsigned int u_int32_t __attribute__ ((__mode__ (__SI__)));
+typedef u_int32_t db_pgno_t;
+typedef struct __db DB;
+typedef struct __db_env DB_ENV;
+typedef struct __db_mpoolfile DB_MPOOLFILE;
+typedef struct __dbc DBC;
+struct __db {
+ DB_MPOOLFILE *mpf;
+ db_pgno_t meta_pgno;
+ struct __cq_aq {
+ } s_links;
+};
+struct __db_env {
+ struct {
+ } xa_txn;
+ u_int32_t flags;
+};
+typedef enum { MU_REMOVE, MU_RENAME, MU_OPEN } mu_action;
+typedef struct __dbpginfo {
+ u_int8_t type;
+} PAGE;
+int __db_master_update(mdbp, sdbp, txn, subdb, type, action, newname, flags)
+ DB *mdbp, *sdbp;
+{
+ DB_ENV *dbenv;
+ DBC *dbc, *ndbc;
+ PAGE *p, *r;
+ int modify, ret, t_ret;
+ if ((ret = __db_cursor(mdbp, txn, &dbc,
+ (((dbenv)->flags & (0x0000002))
+ && modify) ? 35 : 0)) != 0)
+ goto err;
+ switch (action) {
+ case MU_REMOVE:
+ if ((ret = __memp_fget(mdbp->mpf, &sdbp->meta_pgno, 0, &p)) != 0)
+ goto err;
+ if ((((PAGE *)p)->type) == 9) {
+ if ((ret = __db_free(dbc, r)) != 0) { }
+ }
+ if ((ret = __db_free(dbc, p)) != 0) {
+ p = ((void *)0);
+ goto err;
+ }
+ p = ((void *)0);
+ }
+ err:
+ if (ndbc != ((void *)0) && (t_ret = __db_c_close(ndbc)) != 0 && ret == 0)
+ ret = t_ret;
+ return (ret);
+}
+
pr24626-2.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: builtin-convert-3.c
===================================================================
--- builtin-convert-3.c (nonexistent)
+++ builtin-convert-3.c (revision 816)
@@ -0,0 +1,62 @@
+/* Copyright (C) 2004 Free Software Foundation.
+
+ Verify that builtin math functions (with fixed point return types)
+ are converted to smaller FP types correctly by the compiler.
+
+ Written by Kaveh Ghazi, 2004-05-01. */
+
+/* { dg-do link } */
+/* { dg-options "-ffast-math" } */
+/* { dg-options "-ffast-math -mmacosx-version-min=10.3" { target powerpc-*-darwin* } } */
+/* { dg-options "-ffast-math -std=c99" { target *-*-solaris2* } } */
+
+#include "../builtins-config.h"
+
+#define PROTOTYPE1_RET(FN, RET) \
+ extern RET FN(double); \
+ extern RET FN##f(float); \
+ extern RET FN##l(long double);
+
+/* Test converting math builtins to narrower FP types based on if the
+ argument is a narrower type (perhaps implicitly) cast to a wider
+ one. */
+#define INNER_CAST1(MATHFN, RET) \
+ PROTOTYPE1_RET (MATHFN, RET); \
+ extern void link_failure_inner_##MATHFN##l_##MATHFN(void); \
+ extern void link_failure_inner_##MATHFN##l_##MATHFN##f(void); \
+ extern void link_failure_inner_##MATHFN##_##MATHFN##f(void); \
+ if (sizeof (long double) > sizeof (double) \
+ && MATHFN##l(d1) != MATHFN(d1)) \
+ link_failure_inner_##MATHFN##l_##MATHFN(); \
+ if (sizeof (long double) > sizeof (float) \
+ && MATHFN##l(f1) != MATHFN##f(f1)) \
+ link_failure_inner_##MATHFN##l_##MATHFN##f(); \
+ if (sizeof (long double) > sizeof (float) \
+ && MATHFN##l((double)f1) != MATHFN##f(f1)) \
+ link_failure_inner_##MATHFN##l_##MATHFN##f(); \
+ if (sizeof (double) > sizeof (float) \
+ && MATHFN(f1) != MATHFN##f(f1)) \
+ link_failure_inner_##MATHFN##_##MATHFN##f()
+
+void __attribute__ ((__noinline__)) test (double d1, float f1)
+{
+#ifdef __OPTIMIZE__
+#ifdef HAVE_C99_RUNTIME
+ /* We're converting to implicitly generated C99 functions. */
+ INNER_CAST1 (__builtin_lceil, long);
+ INNER_CAST1 (__builtin_llceil, long long);
+ INNER_CAST1 (__builtin_lfloor, long);
+ INNER_CAST1 (__builtin_llfloor, long long);
+ INNER_CAST1 (lround, long);
+ INNER_CAST1 (llround, long long);
+ INNER_CAST1 (lrint, long);
+ INNER_CAST1 (llrint, long long);
+#endif /* HAVE_C99_RUNTIME */
+#endif /* __OPTIMIZE__ */
+}
+
+int main (void)
+{
+ test (1, 2);
+ return 0;
+}
builtin-convert-3.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr27136.c
===================================================================
--- pr27136.c (nonexistent)
+++ pr27136.c (revision 816)
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-ffast-math" } */
+
+void foo()
+{
+ double x;
+
+ for (x = 2; x < 10; x *= x)
+ ;
+}
pr27136.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr28900.c
===================================================================
--- pr28900.c (nonexistent)
+++ pr28900.c (revision 816)
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-ftree-vectorize" } */
+
+int synths_ ( float * rc)
+{
+ float r1, r2;
+ int i;
+ for (i = 0; i < 128; ++i)
+ {
+ r2 = rc[i];
+ r1 = ((r2) <= (.99f) ? (r2) : (.99f));
+ rc[i] = ((r1) >= (-.99f) ? (r1) : (-.99f));
+ }
+}
+
pr28900.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr24626-4.c
===================================================================
--- pr24626-4.c (nonexistent)
+++ pr24626-4.c (revision 816)
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-fmodulo-sched" } */
+
+int foo(short* vec1, short* vec2, short* vec3,int len )
+{
+ int temp,i;
+ for (i=0; i
pr24626-4.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: builtin-ctype-1.c
===================================================================
--- builtin-ctype-1.c (nonexistent)
+++ builtin-ctype-1.c (revision 816)
@@ -0,0 +1,44 @@
+/* Copyright (C) 2004 Free Software Foundation.
+
+ Verify that built-in ctype function attributes are correctly set by
+ the compiler.
+
+ Written by Kaveh Ghazi, 2004-03-23. */
+
+/* { dg-do link } */
+
+
+void test(int i)
+{
+ /* All of these ctype functions should be const/pure and thus
+ eliminated. */
+#define TEST_CTYPE(FN) \
+ extern int FN(int); \
+ extern void link_failure_##FN(void); \
+ if (FN(i) != FN(i)) \
+ link_failure_##FN()
+
+#ifdef __OPTIMIZE__
+ TEST_CTYPE(isalnum);
+ TEST_CTYPE(isalpha);
+ TEST_CTYPE(isascii);
+ TEST_CTYPE(isblank);
+ TEST_CTYPE(iscntrl);
+ TEST_CTYPE(isdigit);
+ TEST_CTYPE(isgraph);
+ TEST_CTYPE(islower);
+ TEST_CTYPE(isprint);
+ TEST_CTYPE(ispunct);
+ TEST_CTYPE(isspace);
+ TEST_CTYPE(isupper);
+ TEST_CTYPE(isxdigit);
+ TEST_CTYPE(toascii);
+ TEST_CTYPE(tolower);
+ TEST_CTYPE(toupper);
+#endif /* __OPTIMIZE__ */
+}
+
+int main (void)
+{
+ return 0;
+}
builtin-ctype-1.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr25654.c
===================================================================
--- pr25654.c (nonexistent)
+++ pr25654.c (revision 816)
@@ -0,0 +1,37 @@
+/* { dg-do run } */
+
+extern void abort (void) __attribute__((noreturn));
+
+union setconflict
+{
+ short a[20];
+ int b[10];
+};
+
+int
+main ()
+{
+ int sum = 0;
+ {
+ union setconflict a;
+ short *c;
+ c = a.a;
+ asm ("": "=r" (c):"0" (c));
+ *c = 0;
+ asm ("": "=r" (c):"0" (c));
+ sum += *c;
+ }
+ {
+ union setconflict a;
+ int *c;
+ c = a.b;
+ asm ("": "=r" (c):"0" (c));
+ *c = 1;
+ asm ("": "=r" (c):"0" (c));
+ sum += *c;
+ }
+
+ if (sum != 1)
+ abort();
+ return 0;
+}
pr25654.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr26763-2.c
===================================================================
--- pr26763-2.c (nonexistent)
+++ pr26763-2.c (revision 816)
@@ -0,0 +1,18 @@
+/* { dg-do run } */
+
+extern void abort(void);
+
+int try (char *a, int d)
+{
+ return a + d > a;
+}
+
+int main(void)
+{
+ char bla[100];
+
+ if (try (bla + 50, -1))
+ abort ();
+
+ return 0;
+}
pr26763-2.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: builtin-noret-1.c
===================================================================
--- builtin-noret-1.c (nonexistent)
+++ builtin-noret-1.c (revision 816)
@@ -0,0 +1,79 @@
+/* Test for builtin noreturn attributes. */
+/* Origin: Joseph Myers */
+/* { dg-options "-multiply_defined suppress" { target powerpc-*-darwin* } } */
+/* { dg-do link } */
+/* { dg-require-weak "" } */
+
+extern void abort (void);
+extern void exit (int);
+extern void _exit (int);
+extern void _Exit (int);
+
+extern void tabort (void);
+extern void texit (void);
+extern void t_exit (void);
+extern void t_Exit (void);
+
+extern void link_failure (void);
+
+/* Some libcs have _exit and/or _Exit, and won't allow it to be re-defined,
+ so make it weak. */
+#pragma weak _exit
+#pragma weak _Exit
+
+int
+main (void)
+{
+ volatile int i = 0;
+ if (i)
+ tabort ();
+ if (i)
+ texit ();
+ if (i)
+ t_exit ();
+ if (i)
+ t_Exit ();
+ exit (0);
+}
+
+void
+tabort (void)
+{
+ abort ();
+ link_failure ();
+}
+
+void
+texit (void)
+{
+ exit (1);
+ link_failure ();
+}
+
+void
+t_exit (void)
+{
+ _exit (1);
+ link_failure ();
+}
+
+/* Some non-Unix libcs might not have _exit. */
+void
+_exit (int i)
+{
+ abort ();
+}
+
+void
+t_Exit (void)
+{
+ _Exit (1);
+ link_failure ();
+}
+
+/* Some libcs might not have _Exit. */
+void
+_Exit (int i)
+{
+ abort ();
+}
builtin-noret-1.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: fp-int-convert-timode.c
===================================================================
--- fp-int-convert-timode.c (nonexistent)
+++ fp-int-convert-timode.c (revision 816)
@@ -0,0 +1,21 @@
+/* Test floating-point conversions. TImode types. */
+/* Origin: Joseph Myers */
+/* { dg-do run { xfail { ia64-*-hpux* && lp64 } } } */
+/* { dg-options "" } */
+
+#include
+#include "fp-int-convert.h"
+
+int
+main (void)
+{
+ TEST_I_F(TItype, UTItype, float, FLT_MANT_DIG);
+ TEST_I_F(TItype, UTItype, double, DBL_MANT_DIG);
+ /* Disable the long double tests when using IBM Extended Doubles.
+ They have variable precision, but constants calculated by gcc's
+ real.c assume fixed precision. */
+#if DBL_MANT_DIG != LDBL_MANT_DIG && LDBL_MANT_DIG != 106
+ TEST_I_F(TItype, UTItype, long double, LDBL_MANT_DIG);
+#endif
+ exit (0);
+}
fp-int-convert-timode.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr26587.c
===================================================================
--- pr26587.c (nonexistent)
+++ pr26587.c (revision 816)
@@ -0,0 +1,29 @@
+/* { dg-do run } */
+/* { dg-require-effective-target int32plus } */
+
+extern void abort(void);
+typedef unsigned int BF_word;
+typedef BF_word BF_key[16 + 2];
+static struct {
+ BF_key P;
+} BF_current;
+int main(void)
+{
+ BF_word L;
+ BF_word tmp4, *ptr;
+ BF_word i;
+ for (i = 0; i < 16 + 2; i++)
+ BF_current.P[i] = i * 0x98765432;
+ L = 0;
+ ptr = BF_current.P;
+ do {
+ ptr += 2;
+ L ^= BF_current.P[0];
+ tmp4 = L >> 24;
+ L = tmp4 ^ BF_current.P[16 + 1];
+ *(ptr - 2) = L;
+ } while (ptr < &BF_current.P[16 + 2]);
+ if (L != 0x1fdb9752)
+ abort();
+ return 0;
+}
pr26587.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property