From: Joseph Myers Date: Thu, 7 Nov 2013 21:20:18 +0000 (+0000) Subject: atomic-compare-exchange-1.c, [...]: Declare main as returning int. X-Git-Tag: releases/gcc-4.9.0~2940 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=722516b81f88d9cb479eb0cf3699c946aa6d3dbe;p=thirdparty%2Fgcc.git 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 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 099c392ad6c7..0e850816bfa4 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,28 @@ +2013-11-07 Joseph Myers + + * 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 * lib/target-supports.exp diff --git a/gcc/testsuite/gcc.dg/atomic-compare-exchange-1.c b/gcc/testsuite/gcc.dg/atomic-compare-exchange-1.c index 2ac54e80887f..4b999c682f2d 100644 --- a/gcc/testsuite/gcc.dg/atomic-compare-exchange-1.c +++ b/gcc/testsuite/gcc.dg/atomic-compare-exchange-1.c @@ -16,6 +16,7 @@ char zero = 0; #define STRONG 0 #define WEAK 1 +int main () { diff --git a/gcc/testsuite/gcc.dg/atomic-compare-exchange-2.c b/gcc/testsuite/gcc.dg/atomic-compare-exchange-2.c index 73b259777480..736e358a6dfc 100644 --- a/gcc/testsuite/gcc.dg/atomic-compare-exchange-2.c +++ b/gcc/testsuite/gcc.dg/atomic-compare-exchange-2.c @@ -16,6 +16,7 @@ short zero = 0; #define STRONG 0 #define WEAK 1 +int main () { diff --git a/gcc/testsuite/gcc.dg/atomic-compare-exchange-3.c b/gcc/testsuite/gcc.dg/atomic-compare-exchange-3.c index 26097288c9d3..91a67cd7423d 100644 --- a/gcc/testsuite/gcc.dg/atomic-compare-exchange-3.c +++ b/gcc/testsuite/gcc.dg/atomic-compare-exchange-3.c @@ -16,6 +16,7 @@ int zero = 0; #define STRONG 0 #define WEAK 1 +int main () { diff --git a/gcc/testsuite/gcc.dg/atomic-compare-exchange-4.c b/gcc/testsuite/gcc.dg/atomic-compare-exchange-4.c index b6c783ddaba8..ac9531b78234 100644 --- a/gcc/testsuite/gcc.dg/atomic-compare-exchange-4.c +++ b/gcc/testsuite/gcc.dg/atomic-compare-exchange-4.c @@ -18,6 +18,7 @@ long long zero = 0; #define STRONG 0 #define WEAK 1 +int main () { diff --git a/gcc/testsuite/gcc.dg/atomic-compare-exchange-5.c b/gcc/testsuite/gcc.dg/atomic-compare-exchange-5.c index 4cc0209b33f9..f5d071affe8f 100644 --- a/gcc/testsuite/gcc.dg/atomic-compare-exchange-5.c +++ b/gcc/testsuite/gcc.dg/atomic-compare-exchange-5.c @@ -17,6 +17,7 @@ __int128_t zero = 0; #define STRONG 0 #define WEAK 1 +int main () { diff --git a/gcc/testsuite/gcc.dg/atomic-exchange-1.c b/gcc/testsuite/gcc.dg/atomic-exchange-1.c index fb78cdbca544..ec8a09c8cc3f 100644 --- a/gcc/testsuite/gcc.dg/atomic-exchange-1.c +++ b/gcc/testsuite/gcc.dg/atomic-exchange-1.c @@ -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. */ diff --git a/gcc/testsuite/gcc.dg/atomic-exchange-2.c b/gcc/testsuite/gcc.dg/atomic-exchange-2.c index 153771a2cdc6..0de2e68208f6 100644 --- a/gcc/testsuite/gcc.dg/atomic-exchange-2.c +++ b/gcc/testsuite/gcc.dg/atomic-exchange-2.c @@ -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. */ diff --git a/gcc/testsuite/gcc.dg/atomic-exchange-3.c b/gcc/testsuite/gcc.dg/atomic-exchange-3.c index fbf8f6b966c0..63a68cf473a1 100644 --- a/gcc/testsuite/gcc.dg/atomic-exchange-3.c +++ b/gcc/testsuite/gcc.dg/atomic-exchange-3.c @@ -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. */ diff --git a/gcc/testsuite/gcc.dg/atomic-exchange-4.c b/gcc/testsuite/gcc.dg/atomic-exchange-4.c index 13022dd38d20..fc1e5081a077 100644 --- a/gcc/testsuite/gcc.dg/atomic-exchange-4.c +++ b/gcc/testsuite/gcc.dg/atomic-exchange-4.c @@ -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. */ diff --git a/gcc/testsuite/gcc.dg/atomic-exchange-5.c b/gcc/testsuite/gcc.dg/atomic-exchange-5.c index b0c84b17fd32..190377f0cd55 100644 --- a/gcc/testsuite/gcc.dg/atomic-exchange-5.c +++ b/gcc/testsuite/gcc.dg/atomic-exchange-5.c @@ -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. */ diff --git a/gcc/testsuite/gcc.dg/atomic-fence.c b/gcc/testsuite/gcc.dg/atomic-fence.c index 1f6d1871a0b6..ab5c7d62c9c8 100644 --- a/gcc/testsuite/gcc.dg/atomic-fence.c +++ b/gcc/testsuite/gcc.dg/atomic-fence.c @@ -6,6 +6,7 @@ /* Test that __atomic_{thread,signal}_fence builtins execute. */ +int main () { __atomic_thread_fence (__ATOMIC_RELAXED); diff --git a/gcc/testsuite/gcc.dg/atomic-flag.c b/gcc/testsuite/gcc.dg/atomic-flag.c index b81cd7832af3..6e79b9027206 100644 --- a/gcc/testsuite/gcc.dg/atomic-flag.c +++ b/gcc/testsuite/gcc.dg/atomic-flag.c @@ -7,6 +7,7 @@ extern void abort(void); unsigned char a; +int main () { int b; diff --git a/gcc/testsuite/gcc.dg/atomic-generic.c b/gcc/testsuite/gcc.dg/atomic-generic.c index d77e97dbf8aa..9b09f87b84ce 100644 --- a/gcc/testsuite/gcc.dg/atomic-generic.c +++ b/gcc/testsuite/gcc.dg/atomic-generic.c @@ -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; diff --git a/gcc/testsuite/gcc.dg/atomic-invalid.c b/gcc/testsuite/gcc.dg/atomic-invalid.c index 48de91f6c75b..4d040e1d5729 100644 --- a/gcc/testsuite/gcc.dg/atomic-invalid.c +++ b/gcc/testsuite/gcc.dg/atomic-invalid.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" } */ diff --git a/gcc/testsuite/gcc.dg/atomic-load-1.c b/gcc/testsuite/gcc.dg/atomic-load-1.c index 928f9b0f10b3..72ca317f209c 100644 --- a/gcc/testsuite/gcc.dg/atomic-load-1.c +++ b/gcc/testsuite/gcc.dg/atomic-load-1.c @@ -10,6 +10,7 @@ extern void abort(void); char v, count; +int main () { v = 0; diff --git a/gcc/testsuite/gcc.dg/atomic-load-2.c b/gcc/testsuite/gcc.dg/atomic-load-2.c index 3d1df1cfffa9..e937a2dab8b0 100644 --- a/gcc/testsuite/gcc.dg/atomic-load-2.c +++ b/gcc/testsuite/gcc.dg/atomic-load-2.c @@ -11,6 +11,7 @@ extern void abort(void); short v, count; +int main () { v = 0; diff --git a/gcc/testsuite/gcc.dg/atomic-load-3.c b/gcc/testsuite/gcc.dg/atomic-load-3.c index ec238be9e517..3e70ef429f6f 100644 --- a/gcc/testsuite/gcc.dg/atomic-load-3.c +++ b/gcc/testsuite/gcc.dg/atomic-load-3.c @@ -8,6 +8,7 @@ extern void abort(void); int v, count; +int main () { v = 0; diff --git a/gcc/testsuite/gcc.dg/atomic-load-4.c b/gcc/testsuite/gcc.dg/atomic-load-4.c index 032ad246fd06..750623dcb63b 100644 --- a/gcc/testsuite/gcc.dg/atomic-load-4.c +++ b/gcc/testsuite/gcc.dg/atomic-load-4.c @@ -9,6 +9,7 @@ extern void abort(void); long long v, count; +int main () { v = 0; diff --git a/gcc/testsuite/gcc.dg/atomic-load-5.c b/gcc/testsuite/gcc.dg/atomic-load-5.c index 31d806633e1c..d37d64248927 100644 --- a/gcc/testsuite/gcc.dg/atomic-load-5.c +++ b/gcc/testsuite/gcc.dg/atomic-load-5.c @@ -8,6 +8,7 @@ extern void abort(void); __int128_t v, count; +int main () { v = 0; diff --git a/gcc/testsuite/gcc.dg/atomic-lockfree.c b/gcc/testsuite/gcc.dg/atomic-lockfree.c index 225428223eaa..093aee9199f7 100644 --- a/gcc/testsuite/gcc.dg/atomic-lockfree.c +++ b/gcc/testsuite/gcc.dg/atomic-lockfree.c @@ -17,6 +17,7 @@ extern void abort(); int r1, r2; /* Test for consistency on sizes 1, 2, 4, 8, 16 and 32. */ +int main () { diff --git a/gcc/testsuite/gcc.dg/atomic-noinline.c b/gcc/testsuite/gcc.dg/atomic-noinline.c index 626254d8a9a7..b3490ea32606 100644 --- a/gcc/testsuite/gcc.dg/atomic-noinline.c +++ b/gcc/testsuite/gcc.dg/atomic-noinline.c @@ -16,6 +16,7 @@ extern void abort(); short as,bs,cs; char ac,bc,cc; +int main () { diff --git a/gcc/testsuite/gcc.dg/atomic-op-1.c b/gcc/testsuite/gcc.dg/atomic-op-1.c index bc1716f77999..a8a97c401b7a 100644 --- a/gcc/testsuite/gcc.dg/atomic-op-1.c +++ b/gcc/testsuite/gcc.dg/atomic-op-1.c @@ -527,6 +527,7 @@ test_or () abort (); } +int main () { test_fetch_add (); diff --git a/gcc/testsuite/gcc.dg/atomic-op-2.c b/gcc/testsuite/gcc.dg/atomic-op-2.c index 8755340cca22..949850345b5b 100644 --- a/gcc/testsuite/gcc.dg/atomic-op-2.c +++ b/gcc/testsuite/gcc.dg/atomic-op-2.c @@ -528,6 +528,7 @@ test_or () abort (); } +int main () { test_fetch_add (); diff --git a/gcc/testsuite/gcc.dg/atomic-op-3.c b/gcc/testsuite/gcc.dg/atomic-op-3.c index 69db4894b638..9a54a2a41783 100644 --- a/gcc/testsuite/gcc.dg/atomic-op-3.c +++ b/gcc/testsuite/gcc.dg/atomic-op-3.c @@ -527,6 +527,7 @@ test_or () abort (); } +int main () { test_fetch_add (); diff --git a/gcc/testsuite/gcc.dg/atomic-op-4.c b/gcc/testsuite/gcc.dg/atomic-op-4.c index 7c4a819bfaae..6990b0e2d751 100644 --- a/gcc/testsuite/gcc.dg/atomic-op-4.c +++ b/gcc/testsuite/gcc.dg/atomic-op-4.c @@ -529,6 +529,7 @@ test_or () abort (); } +int main () { test_fetch_add (); diff --git a/gcc/testsuite/gcc.dg/atomic-op-5.c b/gcc/testsuite/gcc.dg/atomic-op-5.c index e78d81509978..1407f3fe3b24 100644 --- a/gcc/testsuite/gcc.dg/atomic-op-5.c +++ b/gcc/testsuite/gcc.dg/atomic-op-5.c @@ -528,6 +528,7 @@ test_or () abort (); } +int main () { test_fetch_add (); diff --git a/gcc/testsuite/gcc.dg/atomic-param.c b/gcc/testsuite/gcc.dg/atomic-param.c index a1bfc6be87ce..1f2b12690fa5 100644 --- a/gcc/testsuite/gcc.dg/atomic-param.c +++ b/gcc/testsuite/gcc.dg/atomic-param.c @@ -5,6 +5,7 @@ int i; +int main () { diff --git a/gcc/testsuite/gcc.dg/atomic-store-1.c b/gcc/testsuite/gcc.dg/atomic-store-1.c index f99eb9c844f6..1ca5febcf812 100644 --- a/gcc/testsuite/gcc.dg/atomic-store-1.c +++ b/gcc/testsuite/gcc.dg/atomic-store-1.c @@ -9,6 +9,7 @@ extern void abort(void); char v, count; +int main () { v = 0; diff --git a/gcc/testsuite/gcc.dg/atomic-store-2.c b/gcc/testsuite/gcc.dg/atomic-store-2.c index da346fd7de43..c7b1e211a19e 100644 --- a/gcc/testsuite/gcc.dg/atomic-store-2.c +++ b/gcc/testsuite/gcc.dg/atomic-store-2.c @@ -9,6 +9,7 @@ extern void abort(void); short v, count; +int main () { v = 0; diff --git a/gcc/testsuite/gcc.dg/atomic-store-3.c b/gcc/testsuite/gcc.dg/atomic-store-3.c index b691da4592fb..52b30faacdcf 100644 --- a/gcc/testsuite/gcc.dg/atomic-store-3.c +++ b/gcc/testsuite/gcc.dg/atomic-store-3.c @@ -9,6 +9,7 @@ extern void abort(void); int v, count; +int main () { v = 0; diff --git a/gcc/testsuite/gcc.dg/atomic-store-4.c b/gcc/testsuite/gcc.dg/atomic-store-4.c index 0863be99d011..ca37fdc4628c 100644 --- a/gcc/testsuite/gcc.dg/atomic-store-4.c +++ b/gcc/testsuite/gcc.dg/atomic-store-4.c @@ -11,6 +11,7 @@ extern void abort(void); long long v, count; +int main () { v = 0; diff --git a/gcc/testsuite/gcc.dg/atomic-store-5.c b/gcc/testsuite/gcc.dg/atomic-store-5.c index 763d29e240cf..a855182bf49c 100644 --- a/gcc/testsuite/gcc.dg/atomic-store-5.c +++ b/gcc/testsuite/gcc.dg/atomic-store-5.c @@ -10,6 +10,7 @@ extern void abort(void); __int128_t v, count; +int main () { v = 0;