diff options
Diffstat (limited to 'gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++')
37 files changed, 0 insertions, 1727 deletions
diff --git a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/c++.exp b/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/c++.exp deleted file mode 100644 index d42dc8ccd..000000000 --- a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/c++.exp +++ /dev/null @@ -1,47 +0,0 @@ -# APPLE LOCAL file mainline -load_lib libgomp-dg.exp - -global shlib_ext - -set shlib_ext [get_shlib_extension] -set lang_link_flags "-lstdc++" -set lang_test_file_found 0 -set lang_library_path "../libstdc++-v3/src/.libs" - -# Initialize dg. -dg-init - -set blddir [lookfor_file [get_multilibs] libgomp] - -# Look for a static libstdc++ first. -if [file exists "${blddir}/${lang_library_path}/libstdc++.a"] { - set lang_test_file "${lang_library_path}/libstdc++.a" - set lang_test_file_found 1 -# We may have a shared only build, so look for a shared libstdc++. -} elseif [file exists "${blddir}/${lang_library_path}/libstdc++.${shlib_ext}"] { - set lang_test_file "${lang_library_path}/libstdc++.${shlib_ext}" - set lang_test_file_found 1 -# APPLE LOCAL begin mainline candidate -# We may be testing an installed compiler, if $blddir is blank look for 'g++' -} elseif { $blddir == "" } { - verbose -log "Testing an installed compiler - you'd better have installed g++" - set GCC_UNDER_TEST [transform "g++"] - set lang_test_file_found 1 -# APPLE LOCAL end mainline candidate -} else { - puts "No libstdc++ library found, will not execute c++ tests" -} - -if { $lang_test_file_found } { - # Gather a list of all tests. - set tests [lsort [glob -nocomplain $srcdir/$subdir/*.C]] - - set ld_library_path "$always_ld_library_path:${blddir}/${lang_library_path}" - set_ld_library_path_env_vars - - # Main loop. - gfortran-dg-runtest $tests "" -} - -# All done. -dg-finish diff --git a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/copyin-1.C b/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/copyin-1.C deleted file mode 100644 index bc12be2d2..000000000 --- a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/copyin-1.C +++ /dev/null @@ -1,34 +0,0 @@ -// { dg-do run } -// { dg-require-effective-target tls_runtime } - -#include <omp.h> - -extern "C" void abort (void); - -int thr = 32; -#pragma omp threadprivate (thr) - -int -main (void) -{ - int l = 0; - - omp_set_dynamic (0); - omp_set_num_threads (6); - -#pragma omp parallel copyin (thr) reduction (||:l) - { - l = thr != 32; - thr = omp_get_thread_num () + 11; - } - - if (l || thr != 11) - abort (); - -#pragma omp parallel reduction (||:l) - l = thr != omp_get_thread_num () + 11; - - if (l) - abort (); - return 0; -} diff --git a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/copyin-2.C b/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/copyin-2.C deleted file mode 100644 index 024f59980..000000000 --- a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/copyin-2.C +++ /dev/null @@ -1,34 +0,0 @@ -// { dg-do run } -// { dg-require-effective-target tls_runtime } - -#include <omp.h> - -extern "C" void abort (void); - -struct S { int t; char buf[64]; } thr = { 32, "" }; -#pragma omp threadprivate (thr) - -int -main (void) -{ - int l = 0; - - omp_set_dynamic (0); - omp_set_num_threads (6); - -#pragma omp parallel copyin (thr) reduction (||:l) - { - l = thr.t != 32; - thr.t = omp_get_thread_num () + 11; - } - - if (l || thr.t != 11) - abort (); - -#pragma omp parallel reduction (||:l) - l = thr.t != omp_get_thread_num () + 11; - - if (l) - abort (); - return 0; -} diff --git a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/ctor-1.C b/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/ctor-1.C deleted file mode 100644 index 2ad3b3a6e..000000000 --- a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/ctor-1.C +++ /dev/null @@ -1,65 +0,0 @@ -// { dg-do run } - -#include <omp.h> -#include <assert.h> - -struct B -{ - static int icount; - static int dcount; - static int xcount; - - B(); - B(const B &); - ~B(); - B& operator=(const B &); - void doit(); -}; - -int B::icount; -int B::dcount; -int B::xcount; - -B::B() -{ - #pragma omp atomic - icount++; -} - -B::~B() -{ - #pragma omp atomic - dcount++; -} - -void B::doit() -{ - #pragma omp atomic - xcount++; -} - -static int nthreads; - -void foo() -{ - B b; - #pragma omp parallel private(b) - { - #pragma omp master - nthreads = omp_get_num_threads (); - b.doit(); - } -} - -int main() -{ - omp_set_dynamic (0); - omp_set_num_threads (4); - foo(); - - assert (B::xcount == nthreads); - assert (B::icount == nthreads+1); - assert (B::dcount == nthreads+1); - - return 0; -} diff --git a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/ctor-2.C b/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/ctor-2.C deleted file mode 100644 index 6611c592f..000000000 --- a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/ctor-2.C +++ /dev/null @@ -1,76 +0,0 @@ -// { dg-do run } - -#include <omp.h> -#include <assert.h> - -struct B -{ - static int ccount; - static int dcount; - static int xcount; - static B *expected; - - B(); - B(int); - B(const B &); - ~B(); - B& operator=(const B &); - void doit(); -}; - -int B::ccount; -int B::dcount; -int B::xcount; -B * B::expected; - -B::B(int) -{ - expected = this; -} - -B::B(const B &b) -{ - #pragma omp atomic - ccount++; - assert (&b == expected); -} - -B::~B() -{ - #pragma omp atomic - dcount++; -} - -void B::doit() -{ - #pragma omp atomic - xcount++; - assert (this != expected); -} - -static int nthreads; - -void foo() -{ - B b(0); - - #pragma omp parallel firstprivate(b) - { - #pragma omp master - nthreads = omp_get_num_threads (); - b.doit(); - } -} - -int main() -{ - omp_set_dynamic (0); - omp_set_num_threads (4); - foo(); - - assert (B::xcount == nthreads); - assert (B::ccount == nthreads); - assert (B::dcount == nthreads+1); - - return 0; -} diff --git a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/ctor-3.C b/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/ctor-3.C deleted file mode 100644 index e65e4ea52..000000000 --- a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/ctor-3.C +++ /dev/null @@ -1,89 +0,0 @@ -// { dg-do run } - -#include <omp.h> -#include <assert.h> - -struct B -{ - static int icount; - static int dcount; - static int ccount; - static B *e_inner; - static B *e_outer; - - B(); - B(int); - B(const B &); - ~B(); - B& operator=(const B &); - void doit(); -}; - -int B::icount; -int B::dcount; -int B::ccount; -B * B::e_inner; -B * B::e_outer; - -B::B() -{ - #pragma omp atomic - icount++; -} - -B::B(int) -{ - e_outer = this; -} - -B::~B() -{ - #pragma omp atomic - dcount++; -} - -B& B::operator= (const B &b) -{ - assert (&b == e_inner); - assert (this == e_outer); - #pragma omp atomic - ccount++; - return *this; -} - -void B::doit() -{ - #pragma omp critical - { - assert (e_inner == 0); - e_inner = this; - } -} - -static int nthreads; - -void foo() -{ - B b(0); - - #pragma omp parallel sections lastprivate(b) - { - #pragma omp section - nthreads = omp_get_num_threads (); - #pragma omp section - b.doit (); - } -} - -int main() -{ - omp_set_dynamic (0); - omp_set_num_threads (4); - foo(); - - assert (B::ccount == 1); - assert (B::icount == nthreads); - assert (B::dcount == nthreads+1); - - return 0; -} diff --git a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/ctor-4.C b/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/ctor-4.C deleted file mode 100644 index e4f8f82db..000000000 --- a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/ctor-4.C +++ /dev/null @@ -1,90 +0,0 @@ -// { dg-do run } - -#include <omp.h> -#include <assert.h> - -struct B -{ - static int ccount; - static int dcount; - static int ecount; - static B *e_inner; - static B *e_outer; - - B(); - B(int); - B(const B &); - ~B(); - B& operator=(const B &); - void doit(); -}; - -int B::ccount; -int B::dcount; -int B::ecount; -B * B::e_inner; -B * B::e_outer; - -B::B(int) -{ - e_outer = this; -} - -B::B(const B &b) -{ - assert (&b == e_outer); - #pragma omp atomic - ccount++; -} - -B::~B() -{ - #pragma omp atomic - dcount++; -} - -B& B::operator= (const B &b) -{ - assert (&b == e_inner); - assert (this == e_outer); - #pragma omp atomic - ecount++; - return *this; -} - -void B::doit() -{ - #pragma omp critical - { - assert (e_inner == 0); - e_inner = this; - } -} - -static int nthreads; - -void foo() -{ - B b(0); - - #pragma omp parallel sections firstprivate(b) lastprivate(b) - { - #pragma omp section - nthreads = omp_get_num_threads (); - #pragma omp section - b.doit (); - } -} - -int main() -{ - omp_set_dynamic (0); - omp_set_num_threads (4); - foo(); - - assert (B::ecount == 1); - assert (B::ccount == nthreads); - assert (B::dcount == nthreads+1); - - return 0; -} diff --git a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/ctor-5.C b/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/ctor-5.C deleted file mode 100644 index d99a1d462..000000000 --- a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/ctor-5.C +++ /dev/null @@ -1,52 +0,0 @@ -// { dg-do run } -// { dg-require-effective-target tls_runtime } - -#include <omp.h> -#include <assert.h> - -struct B -{ - static int count; - static B *expected; - - B& operator=(const B &); -}; - -int B::count; -B * B::expected; - -static B thr; -#pragma omp threadprivate(thr) - -B& B::operator= (const B &b) -{ - assert (&b == expected); - assert (this != expected); - #pragma omp atomic - count++; - return *this; -} - -static int nthreads; - -void foo() -{ - B::expected = &thr; - - #pragma omp parallel copyin(thr) - { - #pragma omp master - nthreads = omp_get_num_threads (); - } -} - -int main() -{ - omp_set_dynamic (0); - omp_set_num_threads (4); - foo(); - - assert (B::count == nthreads-1); - - return 0; -} diff --git a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/ctor-6.C b/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/ctor-6.C deleted file mode 100644 index eab74e089..000000000 --- a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/ctor-6.C +++ /dev/null @@ -1,50 +0,0 @@ -// { dg-do run } - -#include <omp.h> -#include <assert.h> - -struct B -{ - static int count; - static B *expected; - - B& operator=(const B &); -}; - -int B::count; -B * B::expected; - -B& B::operator= (const B &b) -{ - assert (&b == expected); - assert (this != expected); - #pragma omp atomic - count++; - return *this; -} - -static int nthreads; - -void foo() -{ - #pragma omp parallel - { - B b; - #pragma omp single copyprivate(b) - { - nthreads = omp_get_num_threads (); - B::expected = &b; - } - } -} - -int main() -{ - omp_set_dynamic (0); - omp_set_num_threads (4); - foo(); - - assert (B::count == nthreads-1); - - return 0; -} diff --git a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/ctor-7.C b/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/ctor-7.C deleted file mode 100644 index 3d669a707..000000000 --- a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/ctor-7.C +++ /dev/null @@ -1,67 +0,0 @@ -// { dg-do run } - -#include <omp.h> -#include <assert.h> - -#define N 10 - -struct B -{ - static int icount; - static int dcount; - static int xcount; - - B(); - B(const B &); - ~B(); - B& operator=(const B &); - void doit(); -}; - -int B::icount; -int B::dcount; -int B::xcount; - -B::B() -{ - #pragma omp atomic - icount++; -} - -B::~B() -{ - #pragma omp atomic - dcount++; -} - -void B::doit() -{ - #pragma omp atomic - xcount++; -} - -static int nthreads; - -void foo() -{ - B b[N]; - #pragma omp parallel private(b) - { - #pragma omp master - nthreads = omp_get_num_threads (); - b[0].doit(); - } -} - -int main() -{ - omp_set_dynamic (0); - omp_set_num_threads (4); - foo(); - - assert (B::xcount == nthreads); - assert (B::icount == (nthreads+1)*N); - assert (B::dcount == (nthreads+1)*N); - - return 0; -} diff --git a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/ctor-8.C b/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/ctor-8.C deleted file mode 100644 index 5c0d81b73..000000000 --- a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/ctor-8.C +++ /dev/null @@ -1,77 +0,0 @@ -// { dg-do run } -// { dg-require-effective-target tls_runtime } - -#include <omp.h> -#include <assert.h> - -#define N 10 -#define THR 4 - -struct B -{ - B(); - B(const B &); - ~B(); - B& operator=(const B &); - void doit(); -}; - -static B *base; -static B *threadbase; -static unsigned cmask[THR]; -static unsigned dmask[THR]; - -#pragma omp threadprivate(threadbase) - -B::B() -{ - assert (base == 0); -} - -B::B(const B &b) -{ - unsigned index = &b - base; - assert (index < N); - cmask[omp_get_thread_num()] |= 1u << index; -} - -B::~B() -{ - if (threadbase) - { - unsigned index = this - threadbase; - assert (index < N); - dmask[omp_get_thread_num()] |= 1u << index; - } -} - -void foo() -{ - B b[N]; - - base = b; - - #pragma omp parallel firstprivate(b) - { - assert (omp_get_num_threads () == THR); - threadbase = b; - } - - threadbase = 0; -} - -int main() -{ - omp_set_dynamic (0); - omp_set_num_threads (THR); - foo(); - - for (int i = 0; i < THR; ++i) - { - unsigned xmask = (1u << N) - 1; - assert (cmask[i] == xmask); - assert (dmask[i] == xmask); - } - - return 0; -} diff --git a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/ctor-9.C b/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/ctor-9.C deleted file mode 100644 index 215a901f8..000000000 --- a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/ctor-9.C +++ /dev/null @@ -1,60 +0,0 @@ -// { dg-do run } -// { dg-require-effective-target tls_runtime } - -#include <omp.h> -#include <assert.h> - -#define N 10 -#define THR 4 - -struct B -{ - B& operator=(const B &); -}; - -static B *base; -static B *threadbase; -static int singlethread; -#pragma omp threadprivate(threadbase) - -static unsigned cmask[THR]; - -B& B::operator= (const B &b) -{ - unsigned sindex = &b - base; - unsigned tindex = this - threadbase; - assert(sindex < N); - assert(sindex == tindex); - cmask[omp_get_thread_num ()] |= 1u << tindex; - return *this; -} - -void foo() -{ - #pragma omp parallel - { - B b[N]; - threadbase = b; - #pragma omp single copyprivate(b) - { - assert(omp_get_num_threads () == THR); - singlethread = omp_get_thread_num (); - base = b; - } - } -} - -int main() -{ - omp_set_dynamic (0); - omp_set_num_threads (THR); - foo(); - - for (int i = 0; i < THR; ++i) - if (i == singlethread) - assert(cmask[singlethread] == 0); - else - assert(cmask[i] == (1u << N) - 1); - - return 0; -} diff --git a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/loop-1.C b/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/loop-1.C deleted file mode 100644 index 0e83c9583..000000000 --- a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/loop-1.C +++ /dev/null @@ -1,96 +0,0 @@ -#include <stdlib.h> -#include <stdio.h> -#include <string.h> -#include <omp.h> - -#define MAX 1000 - -void main1() -{ - int i, N1, N2, step; - int a[MAX], b[MAX]; - - N1 = rand () % 13; - N2 = rand () % (MAX - 51) + 50; - step = rand () % 7 + 1; - - printf ("N1 = %d\nN2 = %d\nstep = %d\n", N1, N2, step); - - for (i = N1; i <= N2; i += step) - a[i] = 42+ i; - - /* COUNTING UP (<). Fill in array 'b' in parallel. */ - memset (b, 0, sizeof b); -#pragma omp parallel shared(a,b,N1,N2,step) private(i) - { -#pragma omp for - for (i = N1; i < N2; i += step) - b[i] = a[i]; - } - - /* COUNTING UP (<). Check that all the cells were filled in properly. */ - for (i = N1; i < N2; i += step) - if (a[i] != b[i]) - abort (); - - printf ("for (i = %d; i < %d; i += %d) [OK]\n", N1, N2, step); - - /* COUNTING UP (<=). Fill in array 'b' in parallel. */ - memset (b, 0, sizeof b); -#pragma omp parallel shared(a,b,N1,N2,step) private(i) - { -#pragma omp for - for (i = N1; i <= N2; i += step) - b[i] = a[i]; - } - - /* COUNTING UP (<=). Check that all the cells were filled in properly. */ - for (i = N1; i <= N2; i += step) - if (a[i] != b[i]) - abort (); - - printf ("for (i = %d; i <= %d; i += %d) [OK]\n", N1, N2, step); - - /* COUNTING DOWN (>). Fill in array 'b' in parallel. */ - memset (b, 0, sizeof b); -#pragma omp parallel shared(a,b,N1,N2,step) private(i) - { -#pragma omp for - for (i = N2; i > N1; i -= step) - b[i] = a[i]; - } - - /* COUNTING DOWN (>). Check that all the cells were filled in properly. */ - for (i = N2; i > N1; i -= step) - if (a[i] != b[i]) - abort (); - - printf ("for (i = %d; i > %d; i -= %d) [OK]\n", N2, N1, step); - - /* COUNTING DOWN (>=). Fill in array 'b' in parallel. */ - memset (b, 0, sizeof b); -#pragma omp parallel shared(a,b,N1,N2,step) private(i) - { -#pragma omp for - for (i = N2; i >= N1; i -= step) - b[i] = a[i]; - } - - /* COUNTING DOWN (>=). Check that all the cells were filled in properly. */ - for (i = N2; i >= N1; i -= step) - if (a[i] != b[i]) - abort (); - - printf ("for (i = %d; i >= %d; i -= %d) [OK]\n", N2, N1, step); -} - -int -main () -{ - int i; - - srand (0); - for (i = 0; i < 10; ++i) - main1(); - return 0; -} diff --git a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/loop-2.C b/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/loop-2.C deleted file mode 100644 index ea3dc588a..000000000 --- a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/loop-2.C +++ /dev/null @@ -1,32 +0,0 @@ -#include <omp.h> - -/* Orphaned work sharing. */ - -extern "C" void abort (void); - -#define N 10 - -void parloop (int *a) -{ - int i; - -#pragma omp for - for (i = 0; i < N; i++) - a[i] = i + 3; -} - -main() -{ - int i, a[N]; - -#pragma omp parallel shared(a) - { - parloop (a); - } - - for (i = 0; i < N; i++) - if (a[i] != i + 3) - abort (); - - return 0; -} diff --git a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/loop-3.C b/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/loop-3.C deleted file mode 100644 index fa50f099f..000000000 --- a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/loop-3.C +++ /dev/null @@ -1,26 +0,0 @@ -extern "C" void abort (void); -int a; - -void -foo () -{ - int i; - a = 30; -#pragma omp barrier -#pragma omp for lastprivate (a) - for (i = 0; i < 1024; i++) - { - a = i; - } - if (a != 1023) - abort (); -} - -int -main (void) -{ -#pragma omp parallel num_threads (64) - foo (); - - return 0; -} diff --git a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/loop-4.C b/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/loop-4.C deleted file mode 100644 index 731f23450..000000000 --- a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/loop-4.C +++ /dev/null @@ -1,20 +0,0 @@ -extern "C" void abort (void); - -main() -{ - int i, a; - - a = 30; - -#pragma omp parallel for firstprivate (a) lastprivate (a) \ - num_threads (2) schedule(static) - for (i = 0; i < 10; i++) - a = a + i; - - /* The thread that owns the last iteration will have computed - 30 + 5 + 6 + 7 + 8 + 9 = 65. */ - if (a != 65) - abort (); - - return 0; -} diff --git a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/loop-5.C b/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/loop-5.C deleted file mode 100644 index c427efa85..000000000 --- a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/loop-5.C +++ /dev/null @@ -1,19 +0,0 @@ -extern "C" void abort (); - -int check; -int f1() { check |= 1; return 1; } -int f2() { check |= 2; return 11; } -int f3() { check |= 4; return 2; } - -int a[12]; - -int main() -{ - #pragma omp for - for (int i = f1(); i <= f2(); i += f3()) - a[i] = 1; - - for (int i = 0; i < 12; ++i) - if (a[i] != (i & 1)) - abort (); -} diff --git a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/loop-6.C b/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/loop-6.C deleted file mode 100644 index fa26c6892..000000000 --- a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/loop-6.C +++ /dev/null @@ -1,24 +0,0 @@ -// { dg-do run } - -extern "C" void abort (void); - -volatile int count; -static int test(void) -{ - return ++count > 0; -} - -int main() -{ - int i; - #pragma omp for - for (i = 0; i < 10; ++i) - { - if (test()) - continue; - abort (); - } - if (i != count) - abort (); - return 0; -} diff --git a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/loop-7.C b/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/loop-7.C deleted file mode 100644 index 4eccb7fca..000000000 --- a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/loop-7.C +++ /dev/null @@ -1,22 +0,0 @@ -// PR c++/24502 -// { dg-do run } - -extern "C" void abort (); - -template <typename T> T -foo (T r) -{ - T i; -#pragma omp for - for (i = 0; i < 10; i++) - r += i; - return r; -} - -int -main () -{ - if (foo (0) != 10 * 9 / 2 || foo (2L) != 10L * 9 / 2 + 2) - abort (); - return 0; -} diff --git a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/master-1.C b/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/master-1.C deleted file mode 100644 index 734b4e2cd..000000000 --- a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/master-1.C +++ /dev/null @@ -1,24 +0,0 @@ -// PR c++/24734 -// { dg-do run } - -extern "C" void abort (); -int i; - -template<int> void -foo () -{ - #pragma omp parallel - { - #pragma omp master - i++; - } -} - -int -main () -{ - foo<0> (); - if (i != 1) - abort (); - return 0; -} diff --git a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/nested-1.C b/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/nested-1.C deleted file mode 100644 index 8d0e397bd..000000000 --- a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/nested-1.C +++ /dev/null @@ -1,28 +0,0 @@ -// { dg-do run } - -extern "C" void abort(void); -#define N 1000 - -int foo() -{ - int i = 0, j; - - #pragma omp parallel for num_threads(2) shared (i) - for (j = 0; j < N; ++j) - { - #pragma omp parallel num_threads(1) shared (i) - { - #pragma omp atomic - i++; - } - } - - return i; -} - -int main() -{ - if (foo() != N) - abort (); - return 0; -} diff --git a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/parallel-1.C b/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/parallel-1.C deleted file mode 100644 index 3c9314713..000000000 --- a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/parallel-1.C +++ /dev/null @@ -1,40 +0,0 @@ -#include <omp.h> - -extern "C" void abort (void); - -int -foo (void) -{ - return 10; -} - -main () -{ - int A = 0; - - #pragma omp parallel if (foo () > 10) shared (A) - { - A = omp_get_num_threads (); - } - - if (A != 1) - abort (); - - #pragma omp parallel if (foo () == 10) num_threads (3) shared (A) - { - A = omp_get_num_threads (); - } - - if (A != 3) - abort (); - - #pragma omp parallel if (foo () == 10) num_threads (foo ()) shared (A) - { - A = omp_get_num_threads (); - } - - if (A != 10) - abort (); - - return 0; -} diff --git a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/pr24455-1.C b/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/pr24455-1.C deleted file mode 100644 index e7f38f8ab..000000000 --- a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/pr24455-1.C +++ /dev/null @@ -1,6 +0,0 @@ -// { dg-do compile } -// { dg-require-effective-target tls } -extern int i; -#pragma omp threadprivate (i) - -int i; diff --git a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/pr24455.C b/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/pr24455.C deleted file mode 100644 index ad43b47b2..000000000 --- a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/pr24455.C +++ /dev/null @@ -1,23 +0,0 @@ -// { dg-do run } -// { dg-additional-sources pr24455-1.C } -// { dg-require-effective-target tls_runtime } - -extern "C" void abort (void); - -extern int i; -#pragma omp threadprivate(i) - -int main() -{ - i = 0; - -#pragma omp parallel default(none) num_threads(10) copyin(i) - { - i++; -#pragma omp barrier - if (i != 1) - abort (); - } - - return 0; -} diff --git a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/pr26691.C b/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/pr26691.C deleted file mode 100644 index 776b31e24..000000000 --- a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/pr26691.C +++ /dev/null @@ -1,20 +0,0 @@ -// PR c++/26691 - -struct A -{ - int n; - A (int i = 3) : n (i) {} -}; - -int -main () -{ - A a; - int err = 0; -#pragma omp parallel private (a) reduction (+:err) - if (a.n != 3) - err++; - - return err; - } - diff --git a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/pr26943.C b/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/pr26943.C deleted file mode 100644 index 07b7b5dbf..000000000 --- a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/pr26943.C +++ /dev/null @@ -1,62 +0,0 @@ -// PR c++/26943 -// { dg-do run } - -#include <assert.h> -#include <unistd.h> - -struct S -{ - public: - int x; - S () : x(-1) { } - S (const S &); - S& operator= (const S &); - void test (); -}; - -static volatile int hold; - -S::S (const S &s) -{ - #pragma omp master - sleep (1); - - assert (s.x == -1); - x = 0; -} - -S& -S::operator= (const S& s) -{ - assert (s.x == 1); - x = 2; - return *this; -} - -void -S::test () -{ - assert (x == 0); - x = 1; -} - -static S x; - -void -foo () -{ - #pragma omp sections firstprivate(x) lastprivate(x) - { - x.test(); - } -} - -int -main () -{ - #pragma omp parallel num_threads(2) - foo(); - - assert (x.x == 2); - return 0; -} diff --git a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/pr27337.C b/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/pr27337.C deleted file mode 100644 index 6db2465ec..000000000 --- a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/pr27337.C +++ /dev/null @@ -1,87 +0,0 @@ -// PR middle-end/27337 -// { dg-do run } - -#include <omp.h> - -extern "C" void abort (void); - -struct S -{ - S (); - ~S (); - S (const S &); - int i; -}; - -int n[3]; - -S::S () : i(18) -{ - if (omp_get_thread_num () != 0) -#pragma omp atomic - n[0]++; -} - -S::~S () -{ - if (omp_get_thread_num () != 0) -#pragma omp atomic - n[1]++; -} - -S::S (const S &x) -{ - if (x.i != 18) - abort (); - i = 118; - if (omp_get_thread_num () != 0) -#pragma omp atomic - n[2]++; -} - -S -foo () -{ - int i; - S ret; - -#pragma omp parallel for firstprivate (ret) lastprivate (ret) \ - schedule (static, 1) num_threads (4) - for (i = 0; i < 4; i++) - ret.i += omp_get_thread_num (); - - return ret; -} - -S -bar () -{ - int i; - S ret; - -#pragma omp parallel for num_threads (4) - for (i = 0; i < 4; i++) -#pragma omp atomic - ret.i += omp_get_thread_num () + 1; - - return ret; -} - -S x; - -int -main (void) -{ - omp_set_dynamic (false); - x = foo (); - if (n[0] != 0 || n[1] != 3 || n[2] != 3) - abort (); - if (x.i != 118 + 3) - abort (); - x = bar (); - if (n[0] != 0 || n[1] != 3 || n[2] != 3) - abort (); - if (x.i != 18 + 0 + 1 + 2 + 3 + 4) - abort (); - return 0; -} diff --git a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/pr30703.C b/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/pr30703.C deleted file mode 100644 index d48efd952..000000000 --- a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/pr30703.C +++ /dev/null @@ -1,73 +0,0 @@ -// PR c++/30703 -// { dg-do run } - -#include <omp.h> - -extern "C" void abort (); - -int ctor, cctor, dtor; - -struct A -{ - A(); - A(const A &); - ~A(); - int i; -}; - -A::A() -{ -#pragma omp atomic - ctor++; -} - -A::A(const A &r) -{ - i = r.i; -#pragma omp atomic - cctor++; -} - -A::~A() -{ -#pragma omp atomic - dtor++; -} - -void -foo (A a, A b) -{ - int i, j = 0; -#pragma omp parallel for firstprivate (a) lastprivate (a) private (b) schedule (static, 1) num_threads (5) - for (i = 0; i < 5; i++) - { - b.i = 5; - if (a.i != 6) - #pragma omp atomic - j += 1; - a.i = b.i + i + 6; - } - - if (j || a.i != 15) - abort (); -} - -void -bar () -{ - A a, b; - a.i = 6; - b.i = 7; - foo (a, b); -} - -int -main () -{ - omp_set_dynamic (false); - if (ctor || cctor || dtor) - abort (); - bar (); - if (ctor + cctor != dtor) - abort (); -} diff --git a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/reduction-1.C b/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/reduction-1.C deleted file mode 100644 index 665163af0..000000000 --- a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/reduction-1.C +++ /dev/null @@ -1,36 +0,0 @@ -#include <omp.h> -#include <stdlib.h> - -int -main (void) -{ - int i = 0, j = 0, k = ~0; - double d = 1.0; -#pragma omp parallel num_threads(4) reduction(+:i) reduction(*:d) reduction(&:k) - { - if (i != 0 || d != 1.0 || k != ~0) -#pragma omp atomic - j |= 1; - - if (omp_get_num_threads () != 4) -#pragma omp atomic - j |= 2; - - i = omp_get_thread_num (); - d = i + 1; - k = ~(1 << (2 * i)); - } - - if (j & 1) - abort (); - if ((j & 2) == 0) - { - if (i != (0 + 1 + 2 + 3)) - abort (); - if (d != (1.0 * 2.0 * 3.0 * 4.0)) - abort (); - if (k != (~0 ^ 0x55)) - abort (); - } - return 0; -} diff --git a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/reduction-2.C b/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/reduction-2.C deleted file mode 100644 index 52b3faff7..000000000 --- a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/reduction-2.C +++ /dev/null @@ -1,50 +0,0 @@ -#include <omp.h> -#include <stdlib.h> - -int -main (void) -{ - int i = 0, j = 0, k = ~0, l; - double d = 1.0; -#pragma omp parallel num_threads(4) - { -#pragma omp single - { - i = 16; - k ^= (1 << 16); - d += 32.0; - } - -#pragma omp for reduction(+:i) reduction(*:d) reduction(&:k) - for (l = 0; l < 4; l++) - { - if (omp_get_num_threads () == 4 && (i != 0 || d != 1.0 || k != ~0)) -#pragma omp atomic - j |= 1; - - if (l == omp_get_thread_num ()) - { - i = omp_get_thread_num (); - d = i + 1; - k = ~(1 << (2 * i)); - } - } - - if (omp_get_num_threads () == 4) - { - if (i != (16 + 0 + 1 + 2 + 3)) -#pragma omp atomic - j |= 2; - if (d != (33.0 * 1.0 * 2.0 * 3.0 * 4.0)) -#pragma omp atomic - j |= 4; - if (k != (~0 ^ 0x55 ^ (1 << 16))) -#pragma omp atomic - j |= 8; - } - } - - if (j) - abort (); - return 0; -} diff --git a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/reduction-3.C b/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/reduction-3.C deleted file mode 100644 index 4f8f2fc12..000000000 --- a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/reduction-3.C +++ /dev/null @@ -1,51 +0,0 @@ -#include <omp.h> -#include <stdlib.h> - -int -main (void) -{ - int i = 0, j = 0, k = ~0, l; - double d = 1.0; -#pragma omp parallel num_threads(4) - { -#pragma omp single - { - i = 16; - k ^= (1 << 16); - d += 32.0; - } - -#pragma omp for reduction(+:i) reduction(*:d) reduction(&:k) nowait - for (l = 0; l < 4; l++) - { - if (omp_get_num_threads () == 4 && (i != 0 || d != 1.0 || k != ~0)) -#pragma omp atomic - j |= 1; - - if (l == omp_get_thread_num ()) - { - i = omp_get_thread_num (); - d = i + 1; - k = ~(1 << (2 * i)); - } - } - - if (omp_get_num_threads () == 4) - { -#pragma omp barrier - if (i != (16 + 0 + 1 + 2 + 3)) -#pragma omp atomic - j |= 2; - if (d != (33.0 * 1.0 * 2.0 * 3.0 * 4.0)) -#pragma omp atomic - j |= 4; - if (k != (~0 ^ 0x55 ^ (1 << 16))) -#pragma omp atomic - j |= 8; - } - } - - if (j) - abort (); - return 0; -} diff --git a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/sections-1.C b/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/sections-1.C deleted file mode 100644 index 32c93dbde..000000000 --- a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/sections-1.C +++ /dev/null @@ -1,64 +0,0 @@ -/****************************************************************************** -* FILE: omp_workshare2.c -* DESCRIPTION: -* OpenMP Example - Sections Work-sharing - C/C++ Version -* In this example, the OpenMP SECTION directive is used to assign -* different array operations to threads that execute a SECTION. Each -* thread receives its own copy of the result array to work with. -* AUTHOR: Blaise Barney 5/99 -* LAST REVISED: 04/06/05 -******************************************************************************/ -#include <omp.h> -#include <stdio.h> -#include <stdlib.h> -#define N 50 - -int main (int argc, char *argv[]) { - -int i, nthreads, tid; -float a[N], b[N], c[N]; - -/* Some initializations */ -for (i=0; i<N; i++) - a[i] = b[i] = i * 1.0; - -#pragma omp parallel shared(a,b,nthreads) private(c,i,tid) - { - tid = omp_get_thread_num(); - if (tid == 0) - { - nthreads = omp_get_num_threads(); - printf("Number of threads = %d\n", nthreads); - } - printf("Thread %d starting...\n",tid); - - #pragma omp sections nowait - { - #pragma omp section - { - printf("Thread %d doing section 1\n",tid); - for (i=0; i<N; i++) - { - c[i] = a[i] + b[i]; - printf("Thread %d: c[%d]= %f\n",tid,i,c[i]); - } - } - - #pragma omp section - { - printf("Thread %d doing section 2\n",tid); - for (i=0; i<N; i++) - { - c[i] = a[i] * b[i]; - printf("Thread %d: c[%d]= %f\n",tid,i,c[i]); - } - } - - } /* end of sections */ - - printf("Thread %d done.\n",tid); - - } /* end of parallel section */ - - return 0; -} diff --git a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/shared-1.C b/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/shared-1.C deleted file mode 100644 index 334a553ce..000000000 --- a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/shared-1.C +++ /dev/null @@ -1,60 +0,0 @@ -#include <omp.h> - -extern "C" void abort (void); - -struct Y -{ - int l[5][10]; -}; - -struct X -{ - struct Y y; - float b[10]; -}; - -void -parallel (int a, int b) -{ - int i, j; - struct X A[10][5]; - a = b = 3; - - for (i = 0; i < 10; i++) - for (j = 0; j < 5; j++) - A[i][j].y.l[3][3] = -10; - - #pragma omp parallel shared (a, b, A) num_threads (5) - { - int i, j; - - #pragma omp atomic - a += omp_get_num_threads (); - - #pragma omp atomic - b += omp_get_num_threads (); - - #pragma omp for private (j) - for (i = 0; i < 10; i++) - for (j = 0; j < 5; j++) - A[i][j].y.l[3][3] += 20; - - } - - for (i = 0; i < 10; i++) - for (j = 0; j < 5; j++) - if (A[i][j].y.l[3][3] != 10) - abort (); - - if (a != 28) - abort (); - - if (b != 28) - abort (); -} - -main() -{ - parallel (1, 2); - return 0; -} diff --git a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/shared-2.C b/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/shared-2.C deleted file mode 100644 index 01855fbd4..000000000 --- a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/shared-2.C +++ /dev/null @@ -1,47 +0,0 @@ -extern "C" void abort (void); - -void -parallel (int a, int b) -{ - int bad, LASTPRIV, LASTPRIV_SEC; - int i; - - a = b = 3; - - bad = 0; - - #pragma omp parallel firstprivate (a,b) shared (bad) num_threads (5) - { - if (a != 3 || b != 3) - bad = 1; - - #pragma omp for lastprivate (LASTPRIV) - for (i = 0; i < 10; i++) - LASTPRIV = i; - - #pragma omp sections lastprivate (LASTPRIV_SEC) - { - #pragma omp section - { LASTPRIV_SEC = 3; } - - #pragma omp section - { LASTPRIV_SEC = 42; } - } - - } - - if (LASTPRIV != 9) - abort (); - - if (LASTPRIV_SEC != 42) - abort (); - - if (bad) - abort (); -} - -int main() -{ - parallel (1, 2); - return 0; -} diff --git a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/single-1.C b/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/single-1.C deleted file mode 100644 index e318a48ca..000000000 --- a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/single-1.C +++ /dev/null @@ -1,19 +0,0 @@ -extern "C" void abort (void); - -main() -{ - int i = 0; - - #pragma omp parallel shared (i) - { - #pragma omp single - { - i++; - } - } - - if (i != 1) - abort (); - - return 0; -} diff --git a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/single-2.C b/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/single-2.C deleted file mode 100644 index c2dd22856..000000000 --- a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/single-2.C +++ /dev/null @@ -1,36 +0,0 @@ -extern "C" void abort (void); - -struct X -{ - int a; - char b; - int c; -}; - -main() -{ - int i = 0; - struct X x; - int bad = 0; - - #pragma omp parallel private (i, x) shared (bad) - { - i = 5; - - #pragma omp single copyprivate (i, x) - { - i++; - x.a = 23; - x.b = 42; - x.c = 26; - } - - if (i != 6 || x.a != 23 || x.b != 42 || x.c != 26) - bad = 1; - } - - if (bad) - abort (); - - return 0; -} diff --git a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/single-3.C b/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/single-3.C deleted file mode 100644 index abc7f44b3..000000000 --- a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c++/single-3.C +++ /dev/null @@ -1,21 +0,0 @@ -extern "C" void abort (void); - -void -single (int a, int b) -{ - #pragma omp single copyprivate(a) copyprivate(b) - { - a = b = 5; - } - - if (a != b) - abort (); -} - -int main() -{ - #pragma omp parallel - single (1, 2); - - return 0; -} |