summaryrefslogtreecommitdiff
path: root/Test/dafny4/Bug93.dfy
diff options
context:
space:
mode:
Diffstat (limited to 'Test/dafny4/Bug93.dfy')
-rw-r--r--Test/dafny4/Bug93.dfy37
1 files changed, 37 insertions, 0 deletions
diff --git a/Test/dafny4/Bug93.dfy b/Test/dafny4/Bug93.dfy
new file mode 100644
index 00000000..5a1dd27f
--- /dev/null
+++ b/Test/dafny4/Bug93.dfy
@@ -0,0 +1,37 @@
+// RUN: %dafny /compile:0 "%s" > "%t"
+// RUN: %diff "%s.expect" "%t"
+
+module Fuel {
+ function FunctionA(x:int) : int
+ {
+ x + 2
+ }
+
+ function FunctionB(y:int) : int
+ {
+ FunctionA(y - 2)
+ }
+
+ method {:fuel FunctionA,0,0} MethodX(z:int)
+ {
+ assert FunctionB(z) == z; // error: Cannot see the body of FunctionA
+ }
+}
+
+module Opaque {
+ function {:opaque} FunctionA(x:int) : int
+ {
+ x + 2
+ }
+
+ function FunctionB(y:int) : int
+ {
+ FunctionA(y - 2)
+ }
+
+ method MethodX(z:int)
+ {
+ assert FunctionB(z) == z;
+ }
+}
+