From d17b1767885000ed829eee9e985ae4a680f13377 Mon Sep 17 00:00:00 2001 From: Andrew Waterman Date: Fri, 23 Sep 2022 16:06:21 -0700 Subject: Actually run a program in CI To avoid long CI times, keep the program in binary form. To avoid storing binary files in this repository, store the binaries as an asset on a github release. --- ci-tests/hello.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 ci-tests/hello.c (limited to 'ci-tests/hello.c') diff --git a/ci-tests/hello.c b/ci-tests/hello.c new file mode 100644 index 0000000..cf10e80 --- /dev/null +++ b/ci-tests/hello.c @@ -0,0 +1,23 @@ +#include + +int main() +{ + // As a simple benchmark, estimate pi + int n = 16384, misses = 0; + + for (int i = 0; i < n; i++) { + + for (int j = 0; j < n; j++) { + int x = i - (n / 2); + int y = j - (n / 2); + + misses += (x * x + y * y >= (n / 2) * (n / 2)); + } + } + + double pi = 4.0 * (n * n - misses) / (n * n); + + printf("Hello, world! Pi is approximately %f.\n", pi); + + return 0; +} -- cgit v1.1