aboutsummaryrefslogtreecommitdiffstats
path: root/test/monniaux
diff options
context:
space:
mode:
authorDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2020-04-09 16:27:57 +0200
committerDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2020-04-09 16:27:57 +0200
commitf2e6e7ff8aedb94b42da53ddc6bcd1c9ada38b80 (patch)
treed7a43f7d0d1f1a8eaf984817d17eaed8510ddd31 /test/monniaux
parentdf5dbeebdaed3fd7df3ea9a6bdb9f36e07c288e9 (diff)
parentf38ba5c864ca09b2be8906ae2b0a81e8a57b734b (diff)
downloadcompcert-kvx-f2e6e7ff8aedb94b42da53ddc6bcd1c9ada38b80.tar.gz
compcert-kvx-f2e6e7ff8aedb94b42da53ddc6bcd1c9ada38b80.zip
Merge remote-tracking branch 'origin/mppa-thread' into mppa-work
Diffstat (limited to 'test/monniaux')
-rw-r--r--test/monniaux/thread_local/thread_local.c13
-rw-r--r--test/monniaux/thread_local/thread_local2.c18
2 files changed, 31 insertions, 0 deletions
diff --git a/test/monniaux/thread_local/thread_local.c b/test/monniaux/thread_local/thread_local.c
new file mode 100644
index 00000000..7a50db0a
--- /dev/null
+++ b/test/monniaux/thread_local/thread_local.c
@@ -0,0 +1,13 @@
+#include <stdio.h>
+
+_Thread_local int toto;
+_Thread_local int toto2 = 45;
+
+int foobar(void) {
+ return toto;
+}
+
+int main() {
+ printf("%d %d\n", toto, toto2);
+ return 0;
+}
diff --git a/test/monniaux/thread_local/thread_local2.c b/test/monniaux/thread_local/thread_local2.c
new file mode 100644
index 00000000..ba244ac6
--- /dev/null
+++ b/test/monniaux/thread_local/thread_local2.c
@@ -0,0 +1,18 @@
+#include <stdio.h>
+#include <pthread.h>
+
+_Thread_local int toto;
+_Thread_local int toto2 = 45;
+
+void* poulet(void * dummy) {
+ printf("%p %p\n", &toto, &toto2);
+ return NULL;
+}
+
+int main() {
+ pthread_t thr;
+ poulet(NULL);
+ pthread_create(&thr, NULL, poulet, NULL);
+ pthread_join(thr, NULL);
+ return 0;
+}