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: upstream/12.2.0~66754 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=722516b81f88d9cb479eb0cf3699c946aa6d3dbe;p=platform%2Fupstream%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 099c392..0e85081 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,30 @@ 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 (check_effective_target_fenv_exceptions): New function. * lib/atomic-dg.exp, gcc.dg/atomic/atomic.exp: New files. diff --git a/gcc/testsuite/gcc.dg/atomic-compare-exchange-1.c b/gcc/testsuite/gcc.dg/atomic-compare-exchange-1.c index 2ac54e8..4b999c6 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 73b2597..736e358 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 2609728..91a67cd 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 b6c783d..ac9531b 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 4cc0209..f5d071a 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 fb78cdb..ec8a09c 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 153771a..0de2e68 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 fbf8f6b..63a68cf 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 13022dd..fc1e508 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 b0c84b1..190377f 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 1f6d187..ab5c7d6 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 b81cd78..6e79b90 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 d77e97d..9b09f87 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 48de91f..4d040e1 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 928f9b0..72ca317 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 3d1df1c..e937a2d 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 ec238be..3e70ef4 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 032ad24..750623d 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 31d8066..d37d642 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 2254282..093aee9 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 626254d..b3490ea 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 bc1716f..a8a97c4 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 8755340..9498503 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 69db489..9a54a2a 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 7c4a819..6990b0e 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 e78d815..1407f3f 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 a1bfc6b..1f2b126 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 f99eb9c..1ca5feb 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 da346fd..c7b1e21 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 b691da4..52b30fa 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 0863be9..ca37fdc 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 763d29e..a855182 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;