[m-rev.] diff: enable a test case in the C# and Java grades

Julien Fischer jfischer at opturion.com
Thu Jan 7 14:07:25 AEDT 2021


Enable a test case in the C# and Java grades.

test/hard_coded/Mmakefile:
     Run the pragma_export test in C# and Java grades.

tests/hard_coded/pragma_export.m:
     Add the foreign_proc and foreign_export pragmas required for
     this to work in the Java grade.

Julien.

diff --git a/tests/hard_coded/Mmakefile b/tests/hard_coded/Mmakefile
index 2ba8735..ed8a8fc 100644
--- a/tests/hard_coded/Mmakefile
+++ b/tests/hard_coded/Mmakefile
@@ -281,6 +281,7 @@ ORDINARY_PROGS = \
  	pprint_test \
  	pprint_test2 \
  	pragma_c_code \
+	pragma_export \
  	pragma_foreign_export \
  	pragma_inline \
  	pretty_printing \
@@ -616,7 +617,6 @@ ifeq "$(filter csharp% java%,$(GRADE))" ""
  		factt \
  		factt_sort_test \
  		foreign_type_assertion \
-		pragma_export \
  		runtime_opt \
  		target_mlobjs \
  		weak_ptr
diff --git a/tests/hard_coded/pragma_export.m b/tests/hard_coded/pragma_export.m
index d52c021..f70046f 100644
--- a/tests/hard_coded/pragma_export.m
+++ b/tests/hard_coded/pragma_export.m
@@ -32,5 +32,13 @@ main(!IO) :-
      write_str(Str);
  ").

+:- pragma foreign_proc("Java",
+    my_write_string(Str::in, _IO0::di, _IO::uo),
+    [promise_pure, may_call_mercury, thread_safe],
+"
+    write_str(Str);
+").
+
  :- pragma foreign_export("C", io.write_string(in, di, uo), "write_str").
  :- pragma foreign_export("C#", io.write_string(in, di, uo), "write_str").
+:- pragma foreign_export("Java", io.write_string(in, di, uo), "write_str").


More information about the reviews mailing list