summaryrefslogtreecommitdiff
path: root/Test/triggers/suppressing-warnings-behaves-properly.dfy
blob: 237269e5b3335a8d5342dcd8d8474beac9dcfd45 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// RUN: %dafny /compile:0 /print:"%t.print" /dprint:"%t.dprint" /autoTriggers:1 /printTooltips "%s" > "%t"
// RUN: %diff "%s.expect" "%t"

// This file checks that suppressing warnings works properly

predicate f(x: int)
predicate g(x: int)

method M() {
  assert forall n :: n >= 0 || n < 0;
  assert forall n {:nowarn} :: n >= 0 || n < 0;
  assert forall n {:autotriggers false} :: n >= 0 || n < 0;

  assert forall n: nat :: (n != 0) == f(n) || true;
  assert forall n: nat {:nowarn} :: (n != 0) == f(n) || true;
  assert forall n: nat {:autotriggers false} :: (n != 0) == f(n) || true;

  assert forall n: nat :: f(n) == f(n+1) || g(n) || true;
  assert forall n: nat {:nowarn} :: (n != 0) == f(n) || true;
  assert forall n: nat {:autotriggers false} :: (n != 0) == f(n) || true;
}