cgo: do a basic test that math functions work

They should, but we weren't testing this.
I discovered this while working on
https://github.com/tinygo-org/macos-minimal-sdk/pull/4 which will likely
make math.h not work anymore. So I wanted to make sure we have a test in
place before we update that dependency.
This commit is contained in:
Ayke van Laethem
2024-03-03 20:53:45 +01:00
committed by Ron Evans
parent 7b7601d77c
commit c383a407e3
4 changed files with 14 additions and 0 deletions
+5
View File
@@ -1,3 +1,4 @@
#include <math.h>
#include "main.h"
int global = 3;
@@ -67,3 +68,7 @@ void unionSetData(short f0, short f1, short f2) {
void arraydecay(int buf1[5], int buf2[3][8], int buf3[4][7][2]) {
// Do nothing.
}
double doSqrt(double x) {
return sqrt(x);
}