diff options
Diffstat (limited to 'libgomp')
-rw-r--r-- | libgomp/ChangeLog | 4 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.c++/tls-init1.C | 26 |
2 files changed, 30 insertions, 0 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index ce8384d108d..8ed6abc207c 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,7 @@ +2012-10-04 Jason Merrill <jason@redhat.com> + + * testsuite/libgomp.c++/tls-init1.C: New. + 2012-09-14 David Edelsohn <dje.gcc@gmail.com> * configure: Regenerated. diff --git a/libgomp/testsuite/libgomp.c++/tls-init1.C b/libgomp/testsuite/libgomp.c++/tls-init1.C new file mode 100644 index 00000000000..4cbaccb9851 --- /dev/null +++ b/libgomp/testsuite/libgomp.c++/tls-init1.C @@ -0,0 +1,26 @@ +extern "C" void abort(); + +struct A +{ + A(); + int i; +}; + +extern A a; +#pragma omp threadprivate (a) +A a; + +A &f() +{ + return a; +} + +int j; +A::A(): i(j) { } + +int main() +{ + j = 42; + if (f().i != 42) + abort (); +} |