Skip to content

Commit ff3a088

Browse files
committed
adjust test
1 parent fa938c9 commit ff3a088

File tree

2 files changed

+26
-15
lines changed

2 files changed

+26
-15
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/-!
2+
This test guards against a constant folding bug
3+
-/
4+
5+
6+
def danger : UInt64 := UInt64.ofNat UInt64.size - 1
7+
theorem danger_eq_large : danger = 18446744073709551615 := by decide +kernel
8+
/--
9+
error: Tactic `native_decide` evaluated that the proposition
10+
danger = 1
11+
is false
12+
-/
13+
#guard_msgs in
14+
theorem danger_eq_one : danger = 1 := by native_decide
15+
theorem bad : False := by simpa using danger_eq_large.symm.trans danger_eq_one
16+
17+
def danger2 (x : Nat) : Nat := 0 - x
18+
theorem danger2_eq_zero : danger2 1 = 0 := by decide +kernel
19+
/--
20+
error: Tactic `native_decide` evaluated that the proposition
21+
danger2 1 = 1
22+
is false
23+
-/
24+
#guard_msgs in
25+
theorem danger2_eq_one : danger2 1 = 1 := by native_decide
26+
theorem bad2 : False := by simpa using danger2_eq_zero.symm.trans danger2_eq_one

tests/lean/run/uint_bug_neutral.lean

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)