diff options
author | Jim Wilson <wilson@cygnus.com> | 1999-03-12 16:19:54 +0000 |
---|---|---|
committer | Jim Wilson <wilson@gcc.gnu.org> | 1999-03-12 08:19:54 -0800 |
commit | 6e0f130b0ef9c162289989db9d5906458e0e979e (patch) | |
tree | e163cb34c30892afd0af949b492c4aba4511b1ea /gcc | |
parent | d24de7d183899847d520b453b09cf45c4a643ca4 (diff) | |
download | gcc-6e0f130b0ef9c162289989db9d5906458e0e979e.zip gcc-6e0f130b0ef9c162289989db9d5906458e0e979e.tar.gz gcc-6e0f130b0ef9c162289989db9d5906458e0e979e.tar.bz2 |
Minor testsuite fixes for targets with 16-bit ints and targets without I/O.
* execute/970312-1.c, execute/980605-1.c (f): Change printf to sprintf.
* execute/bf-sign-2.c (struct X): Add u15 field.
(main): Add check for u15. Conditionalize u31 check depending on
whether ints are <32 bits or >=32 bits.
From-SVN: r25730
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/gcc.c-torture/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/970312-1.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/980605-1.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/bf-sign-2.c | 16 |
4 files changed, 27 insertions, 4 deletions
diff --git a/gcc/testsuite/gcc.c-torture/ChangeLog b/gcc/testsuite/gcc.c-torture/ChangeLog index 72749bf..08bc761 100644 --- a/gcc/testsuite/gcc.c-torture/ChangeLog +++ b/gcc/testsuite/gcc.c-torture/ChangeLog @@ -1,3 +1,10 @@ +Fri Mar 12 16:17:28 1999 Jim Wilson <wilson@cygnus.com> + + * execute/970312-1.c, execute/980605-1.c (f): Change printf to sprintf. + * execute/bf-sign-2.c (struct X): Add u15 field. + (main): Add check for u15. Conditionalize u31 check depending on + whether ints are <32 bits or >=32 bits. + 1999-03-01 Zack Weinberg <zack@rabi.columbia.edu> * noncompile/noncompile.exp (951025-1.c): Accept an error diff --git a/gcc/testsuite/gcc.c-torture/execute/970312-1.c b/gcc/testsuite/gcc.c-torture/execute/970312-1.c index b303c4a..6b78ee1 100644 --- a/gcc/testsuite/gcc.c-torture/execute/970312-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/970312-1.c @@ -41,6 +41,8 @@ getval (void) return x++; } +char buf[10]; + void f () { @@ -59,7 +61,7 @@ f () k = f2 (17.0); - printf ("%d\n", a + b + c + d + e + f + g + h + i + j + k); + sprintf (buf, "%d\n", a + b + c + d + e + f + g + h + i + j + k); if (a + b + c + d + e + f + g + h + i + j + k != 227) abort (); } diff --git a/gcc/testsuite/gcc.c-torture/execute/980605-1.c b/gcc/testsuite/gcc.c-torture/execute/980605-1.c index 5ce89a2..2fc2691 100644 --- a/gcc/testsuite/gcc.c-torture/execute/980605-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/980605-1.c @@ -45,6 +45,8 @@ getval (void) return x++; } +char buf[10]; + void f () { @@ -64,7 +66,7 @@ f () k = f2 (17.0); - printf ("%d\n", a + b + c + d + e + f + g + h + i + j + k); + sprintf (buf, "%d\n", a + b + c + d + e + f + g + h + i + j + k); if (a + b + c + d + e + f + g + h + i + j + k != 227) abort (); } diff --git a/gcc/testsuite/gcc.c-torture/execute/bf-sign-2.c b/gcc/testsuite/gcc.c-torture/execute/bf-sign-2.c index 4790822..365e061 100644 --- a/gcc/testsuite/gcc.c-torture/execute/bf-sign-2.c +++ b/gcc/testsuite/gcc.c-torture/execute/bf-sign-2.c @@ -10,7 +10,7 @@ We test the behavior by subtracting two from the promoted value: this will result in a negitive value for signed types, a positive value for unsigned types. This test (of course) assumes that the compiler is correctly - implementing signed and unsigned arithmatic. + implementing signed and unsigned arithmetic. */ struct X { @@ -21,6 +21,7 @@ struct X { unsigned long int u32:32; unsigned long long ull3 :3; unsigned long long ull35:35; + unsigned u15:15; }; struct X x; @@ -36,9 +37,20 @@ main () if ((x.s32 - 2) >= 0) /* promoted value should be signed */ abort (); - if ((x.u31 - 2) >= 0) /* promoted value should be signed */ + if ((x.u15 - 2) >= 0) /* promoted value should be signed */ abort (); + if (sizeof (struct { unsigned long u32:32;}) <= sizeof (int)) + { + if ((x.u31 - 2) >= 0) /* promoted value should be signed */ + abort (); + } + else + { + if ((x.u31 - 2) < 0) /* promoted value should be UNsigned */ + abort (); + } + if ((x.u32 - 2) < 0) /* promoted value should be UNsigned */ abort (); |