Index: tests/io/.expect/eofType.txt
===================================================================
--- tests/io/.expect/eofType.txt	(revision 5db1707751602a75730adf36d02b13b6b98dbfb5)
+++ tests/io/.expect/eofType.txt	(revision 5db1707751602a75730adf36d02b13b6b98dbfb5)
@@ -0,0 +1,40 @@
+false
+false
+true
+eof
+false
+true
+false
+eof
+a
+b
+c
+eof
+a
+b
+c
+eof
+1
+2
+3
+eof
+1
+2
+3
+eof
+1.5
+2.5
+3.5
+eof
+1.5
+2.5
+3.5
+eof
+1.5+1.i
+2.5+1.i
+3.5+1.i
+eof
+1.5+1.i
+2.5+1.i
+3.5+1.i
+eof
Index: tests/io/.in/eofBool.1.txt
===================================================================
--- tests/io/.in/eofBool.1.txt	(revision 5db1707751602a75730adf36d02b13b6b98dbfb5)
+++ tests/io/.in/eofBool.1.txt	(revision 5db1707751602a75730adf36d02b13b6b98dbfb5)
@@ -0,0 +1,1 @@
+    false   false  true
Index: tests/io/.in/eofBool.2.txt
===================================================================
--- tests/io/.in/eofBool.2.txt	(revision 5db1707751602a75730adf36d02b13b6b98dbfb5)
+++ tests/io/.in/eofBool.2.txt	(revision 5db1707751602a75730adf36d02b13b6b98dbfb5)
@@ -0,0 +1,1 @@
+    false  true   false
Index: tests/io/.in/eofChar.1.txt
===================================================================
--- tests/io/.in/eofChar.1.txt	(revision 5db1707751602a75730adf36d02b13b6b98dbfb5)
+++ tests/io/.in/eofChar.1.txt	(revision 5db1707751602a75730adf36d02b13b6b98dbfb5)
@@ -0,0 +1,1 @@
+abc
Index: tests/io/.in/eofChar.2.txt
===================================================================
--- tests/io/.in/eofChar.2.txt	(revision 5db1707751602a75730adf36d02b13b6b98dbfb5)
+++ tests/io/.in/eofChar.2.txt	(revision 5db1707751602a75730adf36d02b13b6b98dbfb5)
@@ -0,0 +1,1 @@
+abc
Index: tests/io/.in/eofComplex.1.txt
===================================================================
--- tests/io/.in/eofComplex.1.txt	(revision 5db1707751602a75730adf36d02b13b6b98dbfb5)
+++ tests/io/.in/eofComplex.1.txt	(revision 5db1707751602a75730adf36d02b13b6b98dbfb5)
@@ -0,0 +1,1 @@
+1.5+1.0 2.5+1.0 3.5+1.0
Index: tests/io/.in/eofComplex.2.txt
===================================================================
--- tests/io/.in/eofComplex.2.txt	(revision 5db1707751602a75730adf36d02b13b6b98dbfb5)
+++ tests/io/.in/eofComplex.2.txt	(revision 5db1707751602a75730adf36d02b13b6b98dbfb5)
@@ -0,0 +1,1 @@
+1.5+1.0 2.5+1.0 3.5+1.0
Index: tests/io/.in/eofDouble.1.txt
===================================================================
--- tests/io/.in/eofDouble.1.txt	(revision 5db1707751602a75730adf36d02b13b6b98dbfb5)
+++ tests/io/.in/eofDouble.1.txt	(revision 5db1707751602a75730adf36d02b13b6b98dbfb5)
@@ -0,0 +1,1 @@
+1.5 2.5 3.5
Index: tests/io/.in/eofDouble.2.txt
===================================================================
--- tests/io/.in/eofDouble.2.txt	(revision 5db1707751602a75730adf36d02b13b6b98dbfb5)
+++ tests/io/.in/eofDouble.2.txt	(revision 5db1707751602a75730adf36d02b13b6b98dbfb5)
@@ -0,0 +1,1 @@
+1.5 2.5 3.5
Index: tests/io/.in/eofInt.1.txt
===================================================================
--- tests/io/.in/eofInt.1.txt	(revision 5db1707751602a75730adf36d02b13b6b98dbfb5)
+++ tests/io/.in/eofInt.1.txt	(revision 5db1707751602a75730adf36d02b13b6b98dbfb5)
@@ -0,0 +1,1 @@
+1 2 3
Index: tests/io/.in/eofInt.2.txt
===================================================================
--- tests/io/.in/eofInt.2.txt	(revision 5db1707751602a75730adf36d02b13b6b98dbfb5)
+++ tests/io/.in/eofInt.2.txt	(revision 5db1707751602a75730adf36d02b13b6b98dbfb5)
@@ -0,0 +1,1 @@
+1 2 3
Index: tests/io/.in/eofText.1.txt
===================================================================
--- tests/io/.in/eofText.1.txt	(revision 5db1707751602a75730adf36d02b13b6b98dbfb5)
+++ tests/io/.in/eofText.1.txt	(revision 5db1707751602a75730adf36d02b13b6b98dbfb5)
@@ -0,0 +1,1 @@
+abcabcabc
Index: tests/io/.in/eofText.2.txt
===================================================================
--- tests/io/.in/eofText.2.txt	(revision 5db1707751602a75730adf36d02b13b6b98dbfb5)
+++ tests/io/.in/eofText.2.txt	(revision 5db1707751602a75730adf36d02b13b6b98dbfb5)
@@ -0,0 +1,1 @@
+abcabcabc
Index: tests/io/eofType.cfa
===================================================================
--- tests/io/eofType.cfa	(revision 5db1707751602a75730adf36d02b13b6b98dbfb5)
+++ tests/io/eofType.cfa	(revision 5db1707751602a75730adf36d02b13b6b98dbfb5)
@@ -0,0 +1,120 @@
+// 
+// Cforall Version 1.0.0 Copyright (C) 2025 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+// 
+// eofType.cfa -- Test for end-of-file with and without a terminating newline across multiple types.
+// 
+// Author           : Peter A. Buhr
+// Created On       : Wed Jan 22 07:41:41 2025
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Wed Jan 22 08:21:25 2025
+// Update Count     : 4
+// 
+
+#include <fstream.hfa>									// sin/sout
+#include <unistd.h>
+
+void openfile( ifstream & testfile, char * filename ) {	// helper
+	try {
+		open( testfile, filename );
+	} catch( open_failure * ex; ex->istream == &testfile ) { // input file errors
+		exit | "Unable to open input file \"" | filename | "\"";
+	} // try
+}
+
+// test.py provides macro IN_DIR, which is the absolute path to the current .in directories.
+#define xstr(s) str(s)
+#define str(s) #s
+// Add quotes around directory name.
+#define INDIR xstr(IN_DIR)
+
+int main() {
+	ifstream testfile;
+	{
+		char * filenames[] = { INDIR "eofBool.1.txt", INDIR "eofBool.2.txt" };
+		bool value;
+
+		for ( i; 2 ) {
+			openfile( testfile, filenames[i] );
+			try {
+				for () {
+					testfile | value;
+					sout | value;
+				} // for
+			} catch( end_of_file * ) {
+				sout | "eof";
+			} // try
+			close( testfile );
+		}
+	}
+	{
+		char * filenames[] = { INDIR "eofChar.1.txt", INDIR "eofChar.2.txt" };
+		char value;
+
+		for ( i; 2 ) {
+			openfile( testfile, filenames[i] );
+			try {
+				for () {
+					testfile | value;
+					sout | value;
+				} // for
+			} catch( end_of_file * ) {
+				sout | "eof";
+			} // try
+			close( testfile );
+		}
+	}
+	{
+		char * filenames[] = { INDIR "eofInt.1.txt", INDIR "eofInt.2.txt" };
+		int value;
+
+		for ( i; 2 ) {
+			openfile( testfile, filenames[i] );
+			try {
+				for () {
+					testfile | value;
+					sout | value;
+				} // for
+			} catch( end_of_file * ) {
+				sout | "eof";
+			} // try
+			close( testfile );
+		}
+	}
+	{
+		char * filenames[] = { INDIR "eofDouble.1.txt", INDIR "eofDouble.2.txt" };
+		double value;
+
+		for ( i; 2 ) {
+			openfile( testfile, filenames[i] );
+			try {
+				for () {
+					testfile | value;
+					sout | value;
+				} // for
+			} catch( end_of_file * ) {
+				sout | "eof";
+			} // try
+			close( testfile );
+		}
+	}
+	{
+		char * filenames[] = { INDIR "eofComplex.1.txt", INDIR "eofComplex.2.txt" };
+		_Complex value;
+
+		for ( i; 2 ) {
+			openfile( testfile, filenames[i] );
+			try {
+				for () {
+					testfile | value;
+					sout | value;
+				} // for
+			} catch( end_of_file * ) {
+				sout | "eof";
+			} // try
+			close( testfile );
+		}
+	}
+}
