summaryrefslogtreecommitdiff
path: root/tests/features/test_build_directives.zc
diff options
context:
space:
mode:
authorZuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian>2026-01-14 23:59:54 +0000
committerZuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian>2026-01-14 23:59:54 +0000
commitdcfdc053cb5f9fb4d5eac0a2233c75126b7a8188 (patch)
treef34f30b382fa22d6fd0af46875a5b4b26d00feff /tests/features/test_build_directives.zc
parenta918df69269a39ef7350a645b5db025d66ecb18a (diff)
Added some of the tests.
Diffstat (limited to 'tests/features/test_build_directives.zc')
-rw-r--r--tests/features/test_build_directives.zc19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/features/test_build_directives.zc b/tests/features/test_build_directives.zc
new file mode 100644
index 0000000..d6e35b3
--- /dev/null
+++ b/tests/features/test_build_directives.zc
@@ -0,0 +1,19 @@
+//> link: -lm
+//> cflags: -O2
+
+// Declare C math function (since we don't have a math stdlib module yet)
+extern fn sin(x: double) -> double;
+
+test "test_build_directives" {
+ println "Running Build Directives Test...";
+ var x = 3.14159 / 2.0; // PI/2
+ var s = sin(x);
+ // sin(PI/2) should be 1.0
+ println "sin(PI/2) = {s}";
+
+ if (s > 0.99 && s < 1.01) {
+ println "Math Link Success!";
+ } else {
+ println "Math Link Failure (Value wrong)";
+ }
+}