[m-rev.] diff: configure tests for different bodies for different modes

Peter Ross peter.ross at miscrit.be
Fri Jun 1 22:25:36 AEST 2001


Hi,


===================================================================


Estimated hours taken: 0.5
Branches: main

configure.in:
    Test that the compiler supports different bodies for different
    modes.


Index: configure.in
===================================================================
RCS file: /home/mercury1/repository/mercury/configure.in,v
retrieving revision 1.258
diff -u -r1.258 configure.in
--- configure.in	2001/05/31 05:59:27	1.258
+++ configure.in	2001/06/01 12:21:43
@@ -89,14 +89,16 @@
 
 		:- implementation.
 	
-		% Check that we can declare foreign_proc for C and MC++.
-		:- pred foo(int::out) is det.
-		:- pragma foreign_proc("C",    foo(X::out),
-			[[will_not_call_mercury, thread_safe]],
-			" X = 42; ").
-		:- pragma foreign_proc("MC++", foo(X::out),
-			[[will_not_call_mercury, thread_safe]],
-			" X = 42; ").
+        
+		% Different bodies for different modes.
+		:- pragma promise_pure(foo/1).
+		:- pred foo(int).
+		:- mode foo(out) is det.
+		:- mode foo(in) is semidet.
+		foo(X::in) :-
+			X = 42.
+		foo(X::out) :-
+			X = 42.
 
 		% Currently we test that mmc accepts the
 		% --fixed-user-guided-type-specialization flag.

--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list