public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [tests/llvm] main: Add a new test for flang
@ 2026-06-10 18:13 Tulio Magno Quites Machado Filho
  0 siblings, 0 replies; only message in thread
From: Tulio Magno Quites Machado Filho @ 2026-06-10 18:13 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : tests/llvm
            Branch : main
            Commit : 48d9d59fc67c495327fce54b0cbebefca183f2b2
            Author : Tulio Magno Quites Machado Filho <tuliom@redhat.com>
            Date   : 2026-06-08T11:02:46-03:00
            Stats  : +41/-0 in 4 file(s)
            URL    : https://src.fedoraproject.org/tests/llvm/c/48d9d59fc67c495327fce54b0cbebefca183f2b2?branch=main

            Log:
            Add a new test for flang

Build and run 2 simple Fortran programs using flang in order to
guarantee we have a flang that does the most basic tasks.

---
diff --git a/tests/flang/hello.f b/tests/flang/hello.f
new file mode 100644
index 0000000..e32b35a
--- /dev/null
+++ b/tests/flang/hello.f
@@ -0,0 +1,3 @@
+      PROGRAM HELLO
+        PRINT '(A)', 'Hello, world'
+      END

diff --git a/tests/flang/main.fmf b/tests/flang/main.fmf
new file mode 100644
index 0000000..85895d6
--- /dev/null
+++ b/tests/flang/main.fmf
@@ -0,0 +1,20 @@
+summary: Run simple tests for flang
+
+tag+:
+  - fedora-only
+
+adjust+:
+  - because: "flang is available for Fedora, not RHEL/CentOS"
+    when: >-
+      distro == rhel
+      or distro == centos
+    enabled: false
+
+  - because: "flang is not built for compat packages"
+    enabled: false
+    when: compat is defined
+
+require+:
+  - flang
+  - llvm-devel
+duration: 1h

diff --git a/tests/flang/sin.f90 b/tests/flang/sin.f90
new file mode 100644
index 0000000..ba091b0
--- /dev/null
+++ b/tests/flang/sin.f90
@@ -0,0 +1,5 @@
+program sin
+    real :: pi
+    pi = 4*atan(1.0)
+    print *, sin(pi/2)
+end program

diff --git a/tests/flang/test.sh b/tests/flang/test.sh
new file mode 100755
index 0000000..6b29663
--- /dev/null
+++ b/tests/flang/test.sh
@@ -0,0 +1,13 @@
+#!/usr/bin/bash
+# Compile and run simple Fortran programs in order to evaluate if Flang is
+# minimally funcional.
+
+set -e
+
+flang hello.f -o hello
+./hello | grep -q "Hello, world"
+rm hello
+
+flang sin.f90 -o sin
+./sin | grep -q "1."
+rm sin

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-06-10 18:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-10 18:13 [tests/llvm] main: Add a new test for flang Tulio Magno Quites Machado Filho

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox