From 873130bbd3343946bbd479c871589ae9494e26f3 Mon Sep 17 00:00:00 2001 From: David Monniaux Date: Sun, 10 Mar 2019 13:44:39 +0100 Subject: forgot the Makefile --- test/monniaux/multithreaded_volatile/Makefile | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 test/monniaux/multithreaded_volatile/Makefile (limited to 'test/monniaux/multithreaded_volatile') diff --git a/test/monniaux/multithreaded_volatile/Makefile b/test/monniaux/multithreaded_volatile/Makefile new file mode 100644 index 00000000..0234b02a --- /dev/null +++ b/test/monniaux/multithreaded_volatile/Makefile @@ -0,0 +1,18 @@ +all: volatile.ccomp.k1c volatile.gcc.k1c + +volatile.ccomp.k1c : volatile.ccomp.k1c.s + k1-cos-gcc $< -o $@ + +volatile.gcc.k1c : volatile.gcc.k1c.s + k1-cos-gcc $< -o $@ + +volatile.ccomp.k1c.s : volatile.c + ../../../ccomp -O2 -Wall -Wno-c11-extensions -S $< -o $@ + +volatile.gcc.k1c.s : volatile.c + k1-cos-gcc -O2 -Wall -Werror=implicit -std=gnu99 -S $< -o $@ + +clean: + -rm -f *.k1c *.s + +.PHONY: clean -- cgit From 075b632376b95ccc8874a0496a2b25b740820084 Mon Sep 17 00:00:00 2001 From: David Monniaux Date: Mon, 11 Mar 2019 21:18:58 +0100 Subject: wrong directory, fixed --- test/monniaux/multithreaded_volatile/volatile.c | 33 +++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 test/monniaux/multithreaded_volatile/volatile.c (limited to 'test/monniaux/multithreaded_volatile') diff --git a/test/monniaux/multithreaded_volatile/volatile.c b/test/monniaux/multithreaded_volatile/volatile.c new file mode 100644 index 00000000..d4e08d6d --- /dev/null +++ b/test/monniaux/multithreaded_volatile/volatile.c @@ -0,0 +1,33 @@ +#include +#include + +int pthread_create(pthread_t *thread, const pthread_attr_t *attr, + void *(*start_routine) (void *), void *arg); +int pthread_join(pthread_t thread, void **retval); + +typedef unsigned data; + +static inline data powM(data x, unsigned e) { + data y = 1; + for(unsigned i=0; i Date: Wed, 10 Apr 2019 18:54:59 +0200 Subject: now compiles with pthread.h --- test/monniaux/multithreaded_volatile/volatile.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'test/monniaux/multithreaded_volatile') diff --git a/test/monniaux/multithreaded_volatile/volatile.c b/test/monniaux/multithreaded_volatile/volatile.c index d4e08d6d..f8ffee2d 100644 --- a/test/monniaux/multithreaded_volatile/volatile.c +++ b/test/monniaux/multithreaded_volatile/volatile.c @@ -1,9 +1,6 @@ #include #include - -int pthread_create(pthread_t *thread, const pthread_attr_t *attr, - void *(*start_routine) (void *), void *arg); -int pthread_join(pthread_t thread, void **retval); +#include typedef unsigned data; -- cgit From 56249c0fa5aa96767ce3fd9be76b8a9e7bef0231 Mon Sep 17 00:00:00 2001 From: David Monniaux Date: Fri, 12 Apr 2019 12:30:49 +0200 Subject: some more simplifications --- test/monniaux/multithreaded_volatile/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/monniaux/multithreaded_volatile') diff --git a/test/monniaux/multithreaded_volatile/Makefile b/test/monniaux/multithreaded_volatile/Makefile index 0234b02a..35717953 100644 --- a/test/monniaux/multithreaded_volatile/Makefile +++ b/test/monniaux/multithreaded_volatile/Makefile @@ -7,7 +7,7 @@ volatile.gcc.k1c : volatile.gcc.k1c.s k1-cos-gcc $< -o $@ volatile.ccomp.k1c.s : volatile.c - ../../../ccomp -O2 -Wall -Wno-c11-extensions -S $< -o $@ + ../../../ccomp -O2 -Wall -S $< -o $@ volatile.gcc.k1c.s : volatile.c k1-cos-gcc -O2 -Wall -Werror=implicit -std=gnu99 -S $< -o $@ -- cgit