Skip to content

Commit 3ae8148

Browse files
committed
app/native-multi-image: Add optional setting to trigger FP exceptions
1 parent 561c6f6 commit 3ae8148

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

app/native-multi-image.F90

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,16 @@ program native_multi_image
5050

5151
write(*,'(A,I1,A,I1,A)') "Hello, world! From image ", me, " of ", ni, " images"
5252

53+
# if SET_EXCEPTIONS
54+
block
55+
! deliberately trigger IEEE arithmetic exceptions: INEXACT and UNDERFLOW
56+
real :: r
57+
r = 1e-30
58+
r = r + r * r
59+
write (*,*) r
60+
end block
61+
# endif
62+
5363
# if HAVE_SYNC_ALL
5464
call status("Testing SYNC ALL...")
5565
call sync_all

0 commit comments

Comments
 (0)