Skip to content

Commit 05c11c8

Browse files
committed
Disable hacky C test with non-C99 GCC
1 parent af06ca9 commit 05c11c8

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

Examples/test-suite/fortran/ccomplextest_runme.F90

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,27 @@ program ccomplextest_runme
88
implicit none
99
complex(C_FLOAT_COMPLEX) :: cflt
1010
complex(C_DOUBLE_COMPLEX) :: cdbl
11+
logical :: do_test = .false.
12+
13+
! Older compilers just wrap the calls, but the C code fails
14+
if (has_c99_complex() == 1) do_test = .true.
1115

1216
cflt = (1, 3) ! 1 + 3i
1317
cflt = Conjf(cflt)
14-
ASSERT(cflt == (1, -3))
18+
if (do_test) then
19+
ASSERT(cflt == (1, -3))
20+
endif
1521

1622
cdbl = (4.0000000001d0, 1d0)
17-
ASSERT(Conj(cdbl) == (4.0000000001d0, -1d0))
23+
if (do_test) then
24+
ASSERT(Conj(cdbl) == (4.0000000001d0, -1d0))
25+
endif
1826

1927
cdbl = (4, 5)
2028
cdbl = Conj2(cdbl)
21-
ASSERT(cdbl == (4d0, -5d0))
29+
if (do_test) then
30+
ASSERT(cdbl == (4d0, -5d0))
31+
endif
2232

2333
end program
2434

0 commit comments

Comments
 (0)