Commit 722516b8 by Joseph Myers Committed by Joseph Myers

atomic-compare-exchange-1.c, [...]: Declare main as returning int.

	* gcc.dg/atomic-compare-exchange-1.c,
	gcc.dg/atomic-compare-exchange-2.c,
	gcc.dg/atomic-compare-exchange-3.c,
	gcc.dg/atomic-compare-exchange-4.c,
	gcc.dg/atomic-compare-exchange-5.c, gcc.dg/atomic-exchange-1.c,
	gcc.dg/atomic-exchange-2.c, gcc.dg/atomic-exchange-3.c,
	gcc.dg/atomic-exchange-4.c, gcc.dg/atomic-exchange-5.c,
	gcc.dg/atomic-fence.c, gcc.dg/atomic-flag.c,
	gcc.dg/atomic-generic.c, gcc.dg/atomic-invalid.c,
	gcc.dg/atomic-load-1.c, gcc.dg/atomic-load-2.c,
	gcc.dg/atomic-load-3.c, gcc.dg/atomic-load-4.c,
	gcc.dg/atomic-load-5.c, gcc.dg/atomic-lockfree.c,
	gcc.dg/atomic-noinline.c, gcc.dg/atomic-op-1.c,
	gcc.dg/atomic-op-2.c, gcc.dg/atomic-op-3.c, gcc.dg/atomic-op-4.c,
	gcc.dg/atomic-op-5.c, gcc.dg/atomic-param.c,
	gcc.dg/atomic-store-1.c, gcc.dg/atomic-store-2.c,
	gcc.dg/atomic-store-3.c, gcc.dg/atomic-store-4.c,
	gcc.dg/atomic-store-5.c: Declare main as returning int.
	* gcc.dg/atomic-exchange-1.c, gcc.dg/atomic-exchange-2.c,
	gcc.dg/atomic-exchange-3.c, gcc.dg/atomic-exchange-4.c,
	gcc.dg/atomic-exchange-5.c: Separate increments of count from
	expression using value of count.

From-SVN: r204545
parent 267bac10
2013-11-07 Joseph Myers <joseph@codesourcery.com>
* gcc.dg/atomic-compare-exchange-1.c,
gcc.dg/atomic-compare-exchange-2.c,
gcc.dg/atomic-compare-exchange-3.c,
gcc.dg/atomic-compare-exchange-4.c,
gcc.dg/atomic-compare-exchange-5.c, gcc.dg/atomic-exchange-1.c,
gcc.dg/atomic-exchange-2.c, gcc.dg/atomic-exchange-3.c,
gcc.dg/atomic-exchange-4.c, gcc.dg/atomic-exchange-5.c,
gcc.dg/atomic-fence.c, gcc.dg/atomic-flag.c,
gcc.dg/atomic-generic.c, gcc.dg/atomic-invalid.c,
gcc.dg/atomic-load-1.c, gcc.dg/atomic-load-2.c,
gcc.dg/atomic-load-3.c, gcc.dg/atomic-load-4.c,
gcc.dg/atomic-load-5.c, gcc.dg/atomic-lockfree.c,
gcc.dg/atomic-noinline.c, gcc.dg/atomic-op-1.c,
gcc.dg/atomic-op-2.c, gcc.dg/atomic-op-3.c, gcc.dg/atomic-op-4.c,
gcc.dg/atomic-op-5.c, gcc.dg/atomic-param.c,
gcc.dg/atomic-store-1.c, gcc.dg/atomic-store-2.c,
gcc.dg/atomic-store-3.c, gcc.dg/atomic-store-4.c,
gcc.dg/atomic-store-5.c: Declare main as returning int.
* gcc.dg/atomic-exchange-1.c, gcc.dg/atomic-exchange-2.c,
gcc.dg/atomic-exchange-3.c, gcc.dg/atomic-exchange-4.c,
gcc.dg/atomic-exchange-5.c: Separate increments of count from
expression using value of count.
2013-11-07 Joseph Myers <joseph@codesourcery.com>
* lib/target-supports.exp
(check_effective_target_fenv_exceptions): New function.
* lib/atomic-dg.exp, gcc.dg/atomic/atomic.exp: New files.
......
......@@ -16,6 +16,7 @@ char zero = 0;
#define STRONG 0
#define WEAK 1
int
main ()
{
......
......@@ -16,6 +16,7 @@ short zero = 0;
#define STRONG 0
#define WEAK 1
int
main ()
{
......
......@@ -16,6 +16,7 @@ int zero = 0;
#define STRONG 0
#define WEAK 1
int
main ()
{
......
......@@ -18,6 +18,7 @@ long long zero = 0;
#define STRONG 0
#define WEAK 1
int
main ()
{
......
......@@ -17,6 +17,7 @@ __int128_t zero = 0;
#define STRONG 0
#define WEAK 1
int
main ()
{
......
......@@ -9,25 +9,31 @@ extern void abort(void);
char v, count, ret;
int
main ()
{
v = 0;
count = 0;
if (__atomic_exchange_n (&v, count + 1, __ATOMIC_RELAXED) != count++)
if (__atomic_exchange_n (&v, count + 1, __ATOMIC_RELAXED) != count)
abort ();
count++;
if (__atomic_exchange_n (&v, count + 1, __ATOMIC_ACQUIRE) != count++)
if (__atomic_exchange_n (&v, count + 1, __ATOMIC_ACQUIRE) != count)
abort ();
count++;
if (__atomic_exchange_n (&v, count + 1, __ATOMIC_RELEASE) != count++)
if (__atomic_exchange_n (&v, count + 1, __ATOMIC_RELEASE) != count)
abort ();
count++;
if (__atomic_exchange_n (&v, count + 1, __ATOMIC_ACQ_REL) != count++)
if (__atomic_exchange_n (&v, count + 1, __ATOMIC_ACQ_REL) != count)
abort ();
count++;
if (__atomic_exchange_n (&v, count + 1, __ATOMIC_SEQ_CST) != count++)
if (__atomic_exchange_n (&v, count + 1, __ATOMIC_SEQ_CST) != count)
abort ();
count++;
/* Now test the generic version. */
......
......@@ -9,25 +9,31 @@ extern void abort(void);
short v, count, ret;
int
main ()
{
v = 0;
count = 0;
if (__atomic_exchange_n (&v, count + 1, __ATOMIC_RELAXED) != count++)
if (__atomic_exchange_n (&v, count + 1, __ATOMIC_RELAXED) != count)
abort ();
count++;
if (__atomic_exchange_n (&v, count + 1, __ATOMIC_ACQUIRE) != count++)
if (__atomic_exchange_n (&v, count + 1, __ATOMIC_ACQUIRE) != count)
abort ();
count++;
if (__atomic_exchange_n (&v, count + 1, __ATOMIC_RELEASE) != count++)
if (__atomic_exchange_n (&v, count + 1, __ATOMIC_RELEASE) != count)
abort ();
count++;
if (__atomic_exchange_n (&v, count + 1, __ATOMIC_ACQ_REL) != count++)
if (__atomic_exchange_n (&v, count + 1, __ATOMIC_ACQ_REL) != count)
abort ();
count++;
if (__atomic_exchange_n (&v, count + 1, __ATOMIC_SEQ_CST) != count++)
if (__atomic_exchange_n (&v, count + 1, __ATOMIC_SEQ_CST) != count)
abort ();
count++;
/* Now test the generic version. */
......
......@@ -9,25 +9,31 @@ extern void abort(void);
int v, count, ret;
int
main ()
{
v = 0;
count = 0;
if (__atomic_exchange_n (&v, count + 1, __ATOMIC_RELAXED) != count++)
if (__atomic_exchange_n (&v, count + 1, __ATOMIC_RELAXED) != count)
abort ();
count++;
if (__atomic_exchange_n (&v, count + 1, __ATOMIC_ACQUIRE) != count++)
if (__atomic_exchange_n (&v, count + 1, __ATOMIC_ACQUIRE) != count)
abort ();
count++;
if (__atomic_exchange_n (&v, count + 1, __ATOMIC_RELEASE) != count++)
if (__atomic_exchange_n (&v, count + 1, __ATOMIC_RELEASE) != count)
abort ();
count++;
if (__atomic_exchange_n (&v, count + 1, __ATOMIC_ACQ_REL) != count++)
if (__atomic_exchange_n (&v, count + 1, __ATOMIC_ACQ_REL) != count)
abort ();
count++;
if (__atomic_exchange_n (&v, count + 1, __ATOMIC_SEQ_CST) != count++)
if (__atomic_exchange_n (&v, count + 1, __ATOMIC_SEQ_CST) != count)
abort ();
count++;
/* Now test the generic version. */
......
......@@ -11,25 +11,31 @@ extern void abort(void);
long long v, count, ret;
int
main ()
{
v = 0;
count = 0;
if (__atomic_exchange_n (&v, count + 1, __ATOMIC_RELAXED) != count++)
if (__atomic_exchange_n (&v, count + 1, __ATOMIC_RELAXED) != count)
abort ();
count++;
if (__atomic_exchange_n (&v, count + 1, __ATOMIC_ACQUIRE) != count++)
if (__atomic_exchange_n (&v, count + 1, __ATOMIC_ACQUIRE) != count)
abort ();
count++;
if (__atomic_exchange_n (&v, count + 1, __ATOMIC_RELEASE) != count++)
if (__atomic_exchange_n (&v, count + 1, __ATOMIC_RELEASE) != count)
abort ();
count++;
if (__atomic_exchange_n (&v, count + 1, __ATOMIC_ACQ_REL) != count++)
if (__atomic_exchange_n (&v, count + 1, __ATOMIC_ACQ_REL) != count)
abort ();
count++;
if (__atomic_exchange_n (&v, count + 1, __ATOMIC_SEQ_CST) != count++)
if (__atomic_exchange_n (&v, count + 1, __ATOMIC_SEQ_CST) != count)
abort ();
count++;
/* Now test the generic version. */
......
......@@ -10,25 +10,31 @@ extern void abort(void);
__int128_t v, count, ret;
int
main ()
{
v = 0;
count = 0;
if (__atomic_exchange_n (&v, count + 1, __ATOMIC_RELAXED) != count++)
if (__atomic_exchange_n (&v, count + 1, __ATOMIC_RELAXED) != count)
abort ();
count++;
if (__atomic_exchange_n (&v, count + 1, __ATOMIC_ACQUIRE) != count++)
if (__atomic_exchange_n (&v, count + 1, __ATOMIC_ACQUIRE) != count)
abort ();
count++;
if (__atomic_exchange_n (&v, count + 1, __ATOMIC_RELEASE) != count++)
if (__atomic_exchange_n (&v, count + 1, __ATOMIC_RELEASE) != count)
abort ();
count++;
if (__atomic_exchange_n (&v, count + 1, __ATOMIC_ACQ_REL) != count++)
if (__atomic_exchange_n (&v, count + 1, __ATOMIC_ACQ_REL) != count)
abort ();
count++;
if (__atomic_exchange_n (&v, count + 1, __ATOMIC_SEQ_CST) != count++)
if (__atomic_exchange_n (&v, count + 1, __ATOMIC_SEQ_CST) != count)
abort ();
count++;
/* Now test the generic version. */
......
......@@ -6,6 +6,7 @@
/* Test that __atomic_{thread,signal}_fence builtins execute. */
int
main ()
{
__atomic_thread_fence (__ATOMIC_RELAXED);
......
......@@ -7,6 +7,7 @@
extern void abort(void);
unsigned char a;
int
main ()
{
int b;
......
......@@ -23,6 +23,7 @@ test_struct a,b;
int size = sizeof (test_struct);
/* Test for consistency on sizes 1, 2, 4, 8, 16 and 32. */
int
main ()
{
test_struct c;
......
......@@ -10,6 +10,7 @@ int i, e, b;
size_t s;
bool x;
int
main ()
{
__atomic_compare_exchange_n (&i, &e, 1, 0, __ATOMIC_RELAXED, __ATOMIC_SEQ_CST); /* { dg-error "failure memory model cannot be stronger" } */
......
......@@ -10,6 +10,7 @@ extern void abort(void);
char v, count;
int
main ()
{
v = 0;
......
......@@ -11,6 +11,7 @@ extern void abort(void);
short v, count;
int
main ()
{
v = 0;
......
......@@ -8,6 +8,7 @@ extern void abort(void);
int v, count;
int
main ()
{
v = 0;
......
......@@ -9,6 +9,7 @@ extern void abort(void);
long long v, count;
int
main ()
{
v = 0;
......
......@@ -8,6 +8,7 @@ extern void abort(void);
__int128_t v, count;
int
main ()
{
v = 0;
......
......@@ -17,6 +17,7 @@ extern void abort();
int r1, r2;
/* Test for consistency on sizes 1, 2, 4, 8, 16 and 32. */
int
main ()
{
......
......@@ -16,6 +16,7 @@ extern void abort();
short as,bs,cs;
char ac,bc,cc;
int
main ()
{
......
......@@ -527,6 +527,7 @@ test_or ()
abort ();
}
int
main ()
{
test_fetch_add ();
......
......@@ -528,6 +528,7 @@ test_or ()
abort ();
}
int
main ()
{
test_fetch_add ();
......
......@@ -527,6 +527,7 @@ test_or ()
abort ();
}
int
main ()
{
test_fetch_add ();
......
......@@ -529,6 +529,7 @@ test_or ()
abort ();
}
int
main ()
{
test_fetch_add ();
......
......@@ -528,6 +528,7 @@ test_or ()
abort ();
}
int
main ()
{
test_fetch_add ();
......
......@@ -5,6 +5,7 @@
int i;
int
main ()
{
......
......@@ -9,6 +9,7 @@ extern void abort(void);
char v, count;
int
main ()
{
v = 0;
......
......@@ -9,6 +9,7 @@ extern void abort(void);
short v, count;
int
main ()
{
v = 0;
......
......@@ -9,6 +9,7 @@ extern void abort(void);
int v, count;
int
main ()
{
v = 0;
......
......@@ -11,6 +11,7 @@ extern void abort(void);
long long v, count;
int
main ()
{
v = 0;
......
......@@ -10,6 +10,7 @@ extern void abort(void);
__int128_t v, count;
int
main ()
{
v = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment