[m-rev.] diff: fix tests/hard_coded/purity for grade IL

Peter Ross pro at missioncriticalit.com
Fri Nov 8 22:02:48 AEDT 2002


Hi,


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


Estimated hours taken: 0.5
Branches: main

tests/hard_coded/purity/impure_func_t1.m:
tests/hard_coded/purity/impure_func_t6.m:
tests/hard_coded/purity/purity.m:
	Update the test cases to compile in the IL grade.


Index: impure_func_t1.m
===================================================================
RCS file: /home/mercury1/repository/tests/hard_coded/purity/impure_func_t1.m,v
retrieving revision 1.2
diff -u -r1.2 impure_func_t1.m
--- impure_func_t1.m	5 Dec 2000 02:11:12 -0000	1.2
+++ impure_func_t1.m	8 Nov 2002 10:53:51 -0000
@@ -23,4 +23,4 @@
 :- pragma c_header_code("extern MR_Integer counter;").
 :- pragma c_code("MR_Integer counter = 0;").
 :- pragma c_code(get_counter = (X::out), will_not_call_mercury, "X = counter;").
-
+get_counter = 0.
Index: impure_func_t6.m
===================================================================
RCS file: /home/mercury1/repository/tests/hard_coded/purity/impure_func_t6.m,v
retrieving revision 1.2
diff -u -r1.2 impure_func_t6.m
--- impure_func_t6.m	5 Dec 2000 02:11:12 -0000	1.2
+++ impure_func_t6.m	8 Nov 2002 10:53:51 -0000
@@ -27,8 +27,8 @@
 :- pragma c_code("MR_Integer counter = 0;").
 :- pragma c_code(get_counter(Y::in) = (X::out), will_not_call_mercury,
 	"X = counter + Y;").
+get_counter(X) = X.
 
 :- pragma c_code(some_pred(Y::in, X::out), will_not_call_mercury,
 	"X = counter + Y;").
-
-
+some_pred(X, X).
Index: purity.m
===================================================================
RCS file: /home/mercury1/repository/tests/hard_coded/purity/purity.m,v
retrieving revision 1.1
diff -u -r1.1 purity.m
--- purity.m	22 Apr 2000 07:12:35 -0000	1.1
+++ purity.m	8 Nov 2002 10:53:51 -0000
@@ -32,31 +32,44 @@
 
 :- impure pred set_x(int::in) is det.
 :- pragma c_code(set_x(X::in), will_not_call_mercury, "x=X;" ).
+:- pragma foreign_proc("C#", set_x(X::in), will_not_call_mercury, "x=X;" ).
 :- pragma no_inline(set_x/1).
 
 :- impure pred incr_x is det.
 :- pragma c_code(incr_x, will_not_call_mercury, "++x;" ).
+:- pragma foreign_proc("C#", incr_x, will_not_call_mercury, "++x;" ).
 :- pragma no_inline(incr_x/0).
 
 :- semipure pred get_x(int::out) is det.
+:- pragma promise_semipure(get_x/1).
 :- pragma c_code(get_x(X::out), will_not_call_mercury, "X=x;").
+:- pragma foreign_proc("C#", get_x(X::out), will_not_call_mercury, "X=x;").
 :- pragma no_inline(get_x/1).
 
 
 :- impure pred set_x_inline(int::in) is det.
 :- pragma c_code(set_x_inline(X::in), will_not_call_mercury, "x=X;" ).
+:- pragma foreign_proc("C#", set_x_inline(X::in),
+		will_not_call_mercury, "x=X;" ).
 :- pragma inline(set_x_inline/1).
 
 :- impure pred incr_x_inline is det.
 :- pragma c_code(incr_x_inline, will_not_call_mercury, "++x;" ).
+:- pragma foreign_proc("C#", incr_x_inline, will_not_call_mercury, "++x;" ).
 :- pragma inline(incr_x_inline/0).
 
 :- semipure pred get_x_inline(int::out) is det.
+:- pragma promise_semipure(get_x_inline/1).
 :- pragma c_code(get_x_inline(X::out), will_not_call_mercury, "X=x;").
+:- pragma foreign_proc("C#", get_x_inline(X::out),
+		will_not_call_mercury, "X=x;").
 :- pragma inline(get_x_inline/1).
 
 
 :- pragma c_header_code("int x = 0;").
+:- pragma foreign_code("C#", "
+static int x = 0;
+").
 
 
 % tempt compiler to optimize away duplicate semipure goals.

--------------------------------------------------------------------------
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