Skip to content

Commit 1d3866a

Browse files
authored
Merge pull request #26 from sourceryinstitute/build-with-flang-new
feat(build): support flang-new
2 parents 1098aad + e6ea632 commit 1d3866a

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

src/assert/assert_subroutine_s.f90 renamed to src/assert/assert_subroutine_s.F90

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,13 @@
2020
check_assertion: &
2121
if (.not. assertion) then
2222

23+
#ifndef __flang__
2324
associate(me=>this_image()) ! work around gfortran bug
2425
header = 'Assertion "' // description // '" failed on image ' // string(me)
2526
end associate
27+
#else
28+
header = 'Assertion "' // description // '" failed.'
29+
#endif
2630

2731
represent_diagnostics_as_string: &
2832
if (.not. present(diagnostic_data)) then

test/unit-tests/designed-to-error-terminate.f90 renamed to test/unit-tests/designed-to-error-terminate.F90

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,21 @@ program designed_to_error_terminate
1616

1717
error_termination = exit_status /=0
1818

19+
#ifndef __flang__
1920
call co_all(error_termination)
2021

2122
if (this_image()==1) then
23+
#endif
2224

2325
if (error_termination) then
2426
print *, "----> All tests designed to error-terminate pass. <----"
2527
else
2628
print *, "----> One or more tests designed to error-terminate terminated normally. Yikes! Who designed this OS? <----"
2729
end if
2830

31+
#ifndef __flang__
2932
end if
33+
#endif
3034

3135
end block
3236

@@ -40,11 +44,13 @@ pure function and_operation(lhs,rhs) result(lhs_and_rhs)
4044

4145
end function
4246

47+
#ifndef __flang__
4348
subroutine co_all(boolean)
4449
logical, intent(inout) :: boolean
4550

4651
call co_reduce(boolean, and_operation)
4752

4853
end subroutine
54+
#endif
4955

5056
end program

test/unit-tests/designed-to-terminate-normally.f90

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,11 @@ program designed_to_terminate_normally
3333

3434
end block array_diagnostic_data
3535

36+
#ifndef __flang__
3637
sync all
3738

38-
if (this_image()==1) print *, "----> All tests designed to terminate normally pass. <----"
39+
if (this_image()==1) &
40+
#endif
41+
print *, "----> All tests designed to terminate normally pass. <----"
3942

4043
end program designed_to_terminate_normally

0 commit comments

Comments
 (0)