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.
This commit is contained in:
parent
f57ec3b76c
commit
48d9d59fc6
4 changed files with 41 additions and 0 deletions
3
tests/flang/hello.f
Normal file
3
tests/flang/hello.f
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
PROGRAM HELLO
|
||||
PRINT '(A)', 'Hello, world'
|
||||
END
|
||||
20
tests/flang/main.fmf
Normal file
20
tests/flang/main.fmf
Normal file
|
|
@ -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
|
||||
5
tests/flang/sin.f90
Normal file
5
tests/flang/sin.f90
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
program sin
|
||||
real :: pi
|
||||
pi = 4*atan(1.0)
|
||||
print *, sin(pi/2)
|
||||
end program
|
||||
13
tests/flang/test.sh
Executable file
13
tests/flang/test.sh
Executable file
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue