repo stringclasses 966
values | path stringlengths 5 283 | license stringclasses 13
values | stars int64 0 3.47k | default_branch stringclasses 15
values | commit_sha stringclasses 966
values | pushed_at stringdate 2015-04-17 10:56:12 2026-07-22 05:29:38 | size_bytes int64 0 1.91M | sha256 stringlengths 64 64 | content stringlengths 0 1.91M |
|---|---|---|---|---|---|---|---|---|---|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/BranchCoverage.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 4,796 | d627149af55b614550055814bd0ca1c03d9c42302002c1b7646d2065c7adfa40 | // RUN: %dafny /useBaseNameForFileName /compile:3 /coverage:- /spillTargetCode:1 /compileTarget:cs %S/BranchCoverage2.cs "%s" > "%t"
// RUN: %dafny /useBaseNameForFileName /compile:3 /coverage:- /spillTargetCode:1 /compileTarget:js %S/BranchCoverage3.js "%s" >> "%t"
// RUN: %dafny /useBaseNameForFileName /compile:3 /... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/BuiltIns.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 3,818 | efd11de4b008b83f6c18f403f3c14d36b0ae634437a9c2a37aed302b0dcfe122 | // RUN: %testDafnyForEachCompiler "%s"
// Essentially a copy of DafnyRuntime/systemModulePopulator.dfy,
// but here independently as a test that all the implicitly-referenced built-ins
// are in fact correctly added to the runtimes.
method HasTuples() {
var b := true;
var has0 := ();
var has1 := (b, gh... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/BuiltIns_Unsupported.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 594 | 4c87258f4724f58fd5c892ffc5773e7806ff83d7c64b1ab50b24ea5ce155667a | // RUN: %testDafnyForEachCompiler "%s"
method HasTuples() {
var b := true;
var has21 := (b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b);
}
method HasArrows() {
var has17 := (x1: bool, x2: bool, x3: bool, x4: bool, x5: bool, x6: bool, x7: bool, x8: bool, x9: bool, x10: bool, x11: bool, x12: bool, x13: bool, ... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/ByMethodCompilation.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 3,416 | fc4d6a48947dc4b7603b9c88102cfe87ed05b55b5eef2f644290d02af34f6535 | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation
method Main() {
var four := Four();
print "four is ", four, "\n"; // 4
print "Recursive(7) = ", Recursive(7), "\n"; // 14
print "NonCompilableFunction: ", NonCompilableFunction(2), " ", NonComp... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Calls.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 4,451 | f5ebf26544c229cb62346c7415217e23574d04bf49df65a4b99dd059efcef243 | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment
function F(x: int, y: bool): int {
x + if y then 2 else 3
}
method A0(x: int, y: bool) {
return;
}
method A1(x: int, y: bool) returns (a: int) {
return a;
}
method A2(x: int, y: bool) returns (a: int, b: ... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Class.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 6,141 | f3e0d440149c7de534fccb2487a2359822010adf3d6248117fd8ff15f2966cb8 | // RUN: %testDafnyForEachCompiler "%s" -- --relax-definite-assignment --spill-translation
class MyClass {
var a: int
const b: int
const c := 17
static const d: int
static const e := 18
constructor (x: int) {
a := 100 + x;
b := 200 + x;
}
function F(): int { 8 }
static function ... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Collections.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 19,100 | 54095f8e3ea3c394506c6ae2f9c374bf18af6ecca20adb2ff750d4e6ea090290 | // NONUNIFORM: https://github.com/dafny-lang/dafny/issues/4108
// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation
method Main() {
Sets();
SubSets();
MultiSets();
Sequences();
Strings();
Maps();
MultiSetForming();
TestExplosiveUnion... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/CompileWithArguments.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 2,195 | 51c982e0a3dca6ffff9b613ea5d56229872b13a1284407923b7c1674e20f3d2e | // NONUNIFORM: Multiple testing scenarios, highly backend sensitive, testing CLI
// RUN: %verify "%s" > "%t"
// RUN: %run --no-verify --target:cs "%s" Csharp 1 >> "%t"
// RUN: %run --no-verify --target:java "%s" -- Java --heya >> "%t"
// RUN: %run --no-verify --target:js "%s" -- Javascript 2 >> "%t"
// RUN: %run -... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/CompileWithArgumentsFail.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 187 | 8f9b4a2f81d495e62270f05b6ecc6e283661d72b072da6dd3774ad86bcdac0ee | // RUN: %verify "%s" > "%t"
// RUN: %exits-with 3 %run --no-verify --target cs "%s" csharp 1 >> "%t"
// RUN: %diff "%s.expect" "%t"
method Main(args: int) {
print "ok", args;
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/CompileWithArgumentsFail2.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 210 | 238040b4ac9cca1d732a5b68e7f4f78e70e5e9da549077936e82656c4d907822 | // RUN: %verify "%s" > "%t"
// RUN: %exits-with 3 %run --no-verify --target cs "%s" csharp 1 >> "%t"
// RUN: %diff "%s.expect" "%t"
method Main(args: array<string>, dummy: int) {
print "ok", dummy;
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Comprehensions.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 18,879 | 99dcd04161942e46f28df3dc5fa8ff37aa061e6c534eb5efbb2193a7720d8788 | // NONUNIFORM: https://github.com/dafny-lang/dafny/issues/4108
// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation
method Main() {
AssignSuchThat();
LetSuchThat();
Quantifier();
MapComprehension();
TestCollectionEmptiness();
OutParamsUnde... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/ComprehensionsNewSyntax.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 9,489 | 628dc000acc3adb2b60cfdff39e8b51c600d8e046382185ac3bfff7d7d822681 | // NONUNIFORM: https://github.com/dafny-lang/dafny/issues/4108
// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation
method Main() {
Quantifier();
MapComprehension();
OutParamsUnderLambdas(); // white-box testing
SetComprehension();
Enumerati... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/CovariantCollections.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 14,852 | 70a20e3b77e7d995c8c686019f2f01b7b70371ab231d2be231776f27e66bf4e9 | // RUN: %testDafnyForEachCompiler "%s" -- --type-system-refresh=false --general-newtypes=false --relax-definite-assignment --spill-translation
method Main() {
Sequences();
Sets();
Multisets();
Maps();
Downcasts();
DeepDowncast();
CovarianceRegressions.Test();
}
trait Number extends object {
... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/CoverageReport.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,774 | 1ee7486194d4d8d998052880b29e4dc672cb7eddbe0e1b6bc2f774baafe71186 | // NONUNIFORM: Out-of-band output (coverage reports) not easily testable via %testDafnyForEachCompiler
// Actual runtime test coverage
// (See also logger/CoverageReport.dfy for verification coverage and expected coverage of generated tests)
// RUN: rm -rf "%t"/execution_testing
// RUN: %baredafny run %args -t:... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/CSharpStyling.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,155 | e3c9ffd40d0420e70cf8e7b2199a66df95a3d4fcfe03e1ca22d329d995c57f25 | // RUN: %run "%s" --input %S/CSharpStyling2.cs > "%t"
// RUN: %diff "%s.expect" "%t"
method Main() {
var c := new MyClass(50);
print c.u, "\n"; // 50
c := new MyClass.Init(true);
print c.u, "\n"; // 2
c := new MyClass.Make(true);
print c.u, "\n"; // 3
var r, s;
r := c.OneResultExtern(2)... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Datatype.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 5,439 | b10ef4ce65aa6e6684e2dab98197763180fb929386503ba941e892aaab6cf090 | // NONUNIFORM: https://github.com/dafny-lang/dafny/issues/4108
// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation
datatype List = Nil | Cons(head: int, tail: List)
method Main() {
var a := Nil;
var b := Cons(5, a);
var c := (a, b);
var d :=... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/DefaultParameters-Compile.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 927 | a83138bc9a20d72b60c9396e3ceb409189ac0315c03872b2a936b8221584f1cb | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation
method M(x: int := 16) {
print x, "\n";
}
class C {
var data: int
method M(x: int := data, y: int := x + 2) {
print x, " ", y, "\n";
}
}
datatype Color = Blue(x: int, y: int := x -... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/DowncastClone.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,585 | 9fd6229e5fd869ebccb23b986fca5e1d5cc0b8e580ffc743b1f1abf5c4386363 | // RUN: %testDafnyForEachCompiler "%s" -- --relax-definite-assignment --general-newtypes=true --type-system-refresh=true
datatype Co<+T> = Co(T) | C
datatype ReCo<+T> = ReCo(T)
datatype Contra<-T> = Contra(f: T -> bool) | C
datatype ReContra<-T> = ReContra(f: T -> bool)
trait X {}
class Y extends X {
con... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/DuplicateArrowNames.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 258 | f77834bdc7bbe3c92876aaebee26e0fa7132061b02d0db5d12ed898573659fb2 | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment
// Previously, this would lead to duplicate variable names in Java, C#,
// and Python.
method Main() {
var f: nat -> nat -> bool;
print f(0)(1), "\n";
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/elseWithHavocStatement.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 204 | 4f942c8bf3cfb64e2aba30fed0fab9bccc7d6b1a3924408eb4f590721196c38d | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s"
method Main() {
var b: bool :| true;
var r: int;
if b {
r := 13;
} else {
r := *;
}
print r;
} |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/ErasableTypeWrappers.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 12,770 | 1a067e97b88921c23bf1d07df92b63a3838232f8ff1303833e1ace6173035acd | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char false --type-system-refresh=true --general-traits=datatype
datatype SingletonRecord = SingletonRecord(u: int)
datatype GhostOrNot = ghost Ghost(a: int, b: int) | Compile... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/EuclideanDivision.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 10,694 | bd53e919156f045016e1bbece4cd2f9785c43841329367f20718ad22ee1ac4a7 | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment
// Some runtimes (like the one for C#) have three implementations
// of Euclidean div/mod: one for `int`, one for `long`, and one
// for `BigInteger`.
const TWO_15: int := 0x0_8000
const TWO_63: int := 0x0_8000_0000_000... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Extern.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 3,805 | a7af2b4c6593ee8f4a40a68256715465afb930f5de3c9f0335c20a0e5d51a768 | // RUN: %verify "%s" > "%t"
// RUN: %run --no-verify --target cs "%s" --input %S/Extern2.cs >> "%t"
// RUN: %run --no-verify --target js "%s" --input %S/Extern3.js >> "%t"
// RUN: %run --no-verify --target go "%s" --input %S/Extern4.go >> "%t"
// RUN: %run --no-verify --target java "%s" --input %S/SingletonOptimiza... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/ExternCopyFromTrait.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 2,903 | 53cc5c6fe1176a2d5c2a0ea5c44d870b49f41936f51f155c58c2c3f2f44bbdf7 | // RUN: %run --target cs "%s" --input %S/ExternCopyFromTraitLibrary.cs > "%t"
// RUN: %diff "%s.expect" "%t"
/// This file tests inheritance of `:extern` annotation in traits.
/// First, we check that `:extern` is correctly inherited by child classes, and
/// can be overridden:
module {:extern "M"} M {
tr... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/ExternCtors.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 762 | 56f0d9d465ee06401e4caa45949fcaddd92ea9b9b7049a361f890321dcac5e0f | // RUN: %run --target cs "%s" --input %S/ExternCtors-externs/Library.cs > "%t"
// RUN: %run --target java "%s" --input %S/ExternCtors-externs/Class.java >> "%t"
// RUN: %run --target py "%s" --input %S/ExternCtors-externs/Library.py >> "%t"
// RUN: %run --target go "%s" --input %S/ExternCtors-externs/Library.go >> "... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/ExternDafnyString.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 739 | f8cb81970b54c76cadc5e25ca6d19a3a85de2a76a61522481af558e9222eb845 | // RUN: %run --target java "%s" --input %S/Conversions.java --input %S/ExternDafnyString.java > "%t"
// RUN: %diff "%s.expect" "%t"
// In this example, the extern method obtains a Java string and returns it as a Dafny string.
class {:extern "java.lang.String"} JavaString {
ghost const value: string
}
method... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/ExternDLL.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,815 | bcb4e04f577b43057f31bd55ee29f0c7da6ffabf583410cde7fc86f142229760 | // RUN: %baredafny build --target=cs %args --allow-external-contracts "%s" %S/ExternDLL2.cs %S/ExternHelloLibrary.dll > "%t"
// RUN: %diff "%s.expect" "%t"
method Main() {
Mod1.Test();
ConstInit.Test();
TwoArgumentExtern.Test();
}
module {:extern "Modx"} Mod1
{
class {:extern "classx"} Class1
{
... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/ExternJavaString.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,326 | 85626d290c3553bb9e880ce1cab372a9ba8147344a6b54d4e5e56ed21e9e7a84 | // RUN: %run --target java "%s" --input %S/Conversions.java --input %S/ExternJavaString.java > "%t"
// RUN: %diff "%s.expect" "%t"
// In this example, the extern method obtains a Java string and returns it as such.
// The Dafny code converts that Java string to a Dafny string.
class {:extern "java.lang.String"} J... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/ExternNestedModule.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 254 | 033d9d24e742bd75cec26669a93df0e8515fafcd8e191d2d4cc2f1c47df9c9b3 | // RUN: %run --target py "%s" --input %S/ExternNestedModule.py > "%t"
// RUN: %diff "%s.expect" "%t"
method Main(){
print Library.THREE, "\n";
}
module {:extern "Nested.Library"} Library {
const THREE := TWO + 1
const TWO: int
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Forall.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 9,543 | fb7e7cbf8336d83cb05dda3b8e694f3cfde3b57d4f292271b2eaf3c9e47feefc | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s"
method Main() {
var arrayTests := new ArrayTests();
arrayTests.Run();
var multiArrayTests := new MultiArrayTests();
multiArrayTests.Run();
var objectTests := new ObjectTests();
objectTests.Run();
ForallWithNewtype.Test();
}
c... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/ForallNewSyntax.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 9,197 | 0dd232b0934b08de4f698ba30809f93f6b25e17f7f727b78af7c88ff40fa0b31 | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --function-syntax:3 --quantifier-syntax:4 --relax-definite-assignment
method Main() {
var arrayTests := new ArrayTests();
arrayTests.Run();
var multiArrayTests := new MultiArrayTests();
multiArrayTests.Run();
var objectTests := new Ob... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/ForLoops-Compilation.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 8,101 | 1778d3914e17b5fcb4c0f7408072258cc70fd8216f886b0216d98fb4b5f34d81 | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation
method Main() {
TestM(0, 0);
TestM(-2, 2);
TestM(-2, 3);
TestM(10, 20);
TestP(0, 0);
TestP(28, 28);
TestP(28, 30);
TestP(255, 255); // this one requires an unsigned comparison in ... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/GeneralNewtypes.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 18,390 | 9781640fe783d05e7c66fe81dd403654b1f62b51ec1bb9e0c7c6e4c796d14280 | // RUN: %testDafnyForEachCompiler "%s" -- --relax-definite-assignment --type-system-refresh=true --general-newtypes=true
method Main() {
Numerics.Test();
SimpleBoolAndint.Test();
TrivialConstraint.Test();
BaseTypesThatAreSubsetTypes.Test();
TypeDescriptors.Test();
PrintChars.Test();
Bitvectors.T... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Ghosts.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,724 | db3b1386ab3110f2118aa1ee6298c14cb189a513f221bca37042a0a0692e6fa7 | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation
method M1() returns (x: int)
{
print "hello, M1\n";
}
method M2() returns (x: int, ghost y: int)
{
print "hello, M2\n";
}
method M3() returns (x: int, ghost y: int, z: int)
{
print "hel... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/GoEmptyParentModules.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 249 | ce371c571792d965321ec4872581b7b1a51187a66e9923f43aac075375d53162 | // RUN: %baredafny translate go %args %s
// RUN: %OutputCheck --file-to-check %S/GoEmptyParentModules-go/src/GoEmptyParentModules.go "%s"
// CHECK-NOT: "A"
// CHECK-NOT: "A_B"
module A.B.C {
method Main() {
print "Hi there!\n";
}
} |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Hello.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 223 | 094fbf2fc7567215ff20ed7ccf21630420e4383cb6fc57fb0f0438b5b27b2fb7 | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s"
method Main() {
print "Hello, World! Best, Dafny\n";
var x := 14;
print "x is ", x, "\n";
var y := false;
print "y is ", y, "\n";
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Iterators.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,832 | 925038fdfde3c35423e8131300b219c7493520809c3e2f762de12facc8a26d09 | // RUN: %testDafnyForEachCompiler "%s"
class C {
var x: int
// for variety, the following tests the use of an instance Main method
method Main(ghost u: int) returns (ghost r: bool, ghost s: bool) {
print "hello, instance\n";
print "x is ", x, "\n";
Client();
RegressionClient();
r :=... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/JsModule.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 930 | 0eb7c8b9653454c35a14251837b15864d4b65b1cac21b425dfe2646d348b9a6b | // NONUNIFORM: Javascript-specific extern test
// RUN: %run --unicode-char false --target js "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
// "url" is a built-in package in node, so it should be accessible to the
// test suite without further requirements on the setup.
module {:extern "url", "url"} URL {
class U... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Let.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 2,459 | 1d43783eb4b6b5fe0be4ea04fd1030ac5a90b37b9d401f869f60e30f1af57b29 | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation
method M() returns (x: int) {
x := var y := 50; y; // non-top-level let
}
function F(): int {
var r := 58; r // top-level let
}
method Main() {
var m := M();
var f := F();
print m,... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/MainMethod.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 4,434 | 8f07845946748e6a6fb622e4c21a9a5799352c9601302243846042f9ac9bcdda | // NONUNIFORM: multiple testing scenarios (could be split into several uniform tests)
// RUN: %verify "%s" > "%t"
// RUN: %run --no-verify --main-method Cl.Static --target cs "%s" >> "%t"
// RUN: %run --no-verify --main-method Cl.Instance --target cs "%s" >> "%t"
// RUN: %run --no-verify --main-method Tr.Static... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Module.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 264 | a447a7fe4ebde2caa6265f1e01041ee785a360a911396630e1160bcc6ea87a47 | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s"
// Simple sanity test of nested modules
module Parent {
module Child {
method Test() {
print "hi from a nested module\n";
}
}
}
method Main() {
Parent.Child.Test();
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/MoreAutoInit.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 15,305 | 8a81b31b17852de64a07a664f965d1969ee8087b84af000c68e65c893613632c | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment
method Main() {
Methods.TestStart();
Functions.TestStart();
Consts.TestStart();
FunctionsAsValues.TestStart();
DefaultValuedExpressions.TestStart();
}
module Methods {
newtype Newtype = x | 0 <= x < 500 ... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/NativeNumbers.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 11,399 | 4e5685e44bf8e79ef11cec4afc4ec86bbe6db8462f2d7c532b301ab0bd05ff69 | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation
// Skip JavaScript because JavaScript doesn't have the same native types
method Main() {
CastTests();
DefaultTests();
Int8Test();
Int16Test();
BvTests();
ZeroComparisonTests();
}
n... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/NestedArrays.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 2,725 | 9ed9ca5acb6cbd4543f378f62617c74395e5d1a36d4cac97151d3635046061bb | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment
/* Note, compiling to arrays in Java is difficult. In fact, this is currently
* broken, see https://github.com/dafny-lang/dafny/issues/3055. Until this gets
* fixed, Java is omitted from this file.
*
* Also, note, the... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Numbers.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 22,468 | bf00f70cdf8ca8f01612d90fa532efb53584d5e89f4481595a5686f46e2e7f03 | // NONUNIFORM: https://github.com/dafny-lang/dafny/issues/4174
// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --type-system-refresh=false --general-newtypes=false --relax-definite-assignment
method Main() {
Literals();
Arithmetic();
PrintReals();
SimpleReality();
BitVectorTests();
... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Poly.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 4,106 | 996cd729f5a991fe09eaabb4f3230619356ce6d14c567e56b5d529df091b74de | // NONUNIFORM: https://github.com/dafny-lang/dafny/issues/4174
// RUN: %testDafnyForEachCompiler "%s" -- --relax-definite-assignment --spill-translation
trait Shape extends object {
function Center(): (real, real) reads this
method PrintCenter() {
print "Center: ", this.Center(), "\n";
}
}
class S... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Print.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 893 | baeefd2f1d7a2bd3c6d806b885dddfbe84bbd6e8be70ee36a4ba527323b086e7 | // NONUNIFORM: https://github.com/dafny-lang/dafny/issues/4108 and https://github.com/dafny-lang/dafny/issues/2582
// RUN: %verify --relax-definite-assignment "%s" > "%t"
// RUN: %run --no-verify --target cs "%s" >> "%t"
// RUN: %run --no-verify --target js "%s" >> "%t"
// RUN: %run --no-verify --target go "%s" >> ... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/SequenceConcatOptimization.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 934 | 30af15f598c0a41987b26d1590aaf968f9e9934b6a5715a01ef7b336ea4ec229 | // RUN: %verify "%s" > "%t"
// RUN: %baredafny test --no-verify --target=cs %args "%s" >> "%t"
// RUN: %baredafny test --no-verify --target=java %args "%s" >> "%t"
// RUN: %baredafny test --no-verify --target=go %args "%s" >> "%t"
// RUN: %baredafny test --no-verify --target=py %args "%s" >> "%t"
module Se... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/StaticMembersOfGenericTypes.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 4,779 | 0f9890209e48961cdd059590b7936ff831cc27b3787a0e80a8b63ec209f6d7d9 | // RUN: %testDafnyForEachCompiler "%s" -- --relax-definite-assignment
method Main() {
GenericClass();
FunctionValues();
Coercions();
}
// ------------------------------------------------------------
method GenericClass() {
var bb, aa, gg, hh, f2, f3;
f2 := (x, y) => (x, y);
f3 := (x, y, z) =... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/TailRecursion.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 9,678 | 007f21c053f2ef2bb76aa54775043ea152d503d70120e5cfd188977e7d82dcca | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment
method Main() {
// In the following, 2_000_000 is too large an argument without tail-calls
var x := M(2_000_000, 0);
var y := F(2_000_000, 0);
print x, " ", y, "\n"; // 2_000_000 2_000_000
x := TestMethod(2_... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/TupleMaximumSize.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 169 | adbd244438d5811fed322dbbd7c942c826a2660c0d1a6a8efd62293a6eead10f | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s"
method Main() {
var a := (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21);
print a, "\n";
} |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/TypeDescriptors.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 4,052 | bc07404b915300ec0b51cb91ebc8f13e37eda920834a7206b53400fd6845b01f | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment
method Method<G(0)>(s: string, g: G) {
var zero: G;
print s, ": ", g, " ", zero, "\n";
}
method MethodX<G(0)>(s: string, g: G) { // don't print g
var zero: G;
print s, ": ", zero, "\n";
}
method Get<G(0)>... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/TypeParams.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 5,205 | 6f1acf4e230acd74f70e254612b6cb8c1550148229c762c485717db3fa275357 | // NONUNIFORM: https://github.com/dafny-lang/dafny/issues/4119
// RUN: %testDafnyForEachCompiler "%s" -- --relax-definite-assignment --spill-translation
datatype Color = Orange | Pink | Teal
type Six = x | x <= 6
newtype Even = x | x % 2 == 0
// types with non-standard (which essentially means non-0) initial... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/UnicodeStrings.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 9,241 | 31ea9c83201666c3ee72a22732c36f28561485e55f7228fdd8cbd13a5f152eeb | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --type-system-refresh=false --general-newtypes=false --unicode-char
method AssertAndExpect(p: bool)
requires p
{
expect p;
}
// Included to test casting between char and all supported native types
newtype uint8 = x: int | 0 <= x < 0x100
n... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Uninitialized.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 7,504 | 8b1db83b3a84cf4fb563507052219fa146dab015b84e3a98c6923396d08ad17e | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s"
module {:options "--function-syntax=4"} Stacks {
export
reveals Stack
provides Stack.Valid, Stack.Repr, Stack.Elements
reveals Stack.Count
provides Stack.Push, Stack.Pop
datatype MaybeInitialized<T> = ghost Uninitialized | Initi... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/UnoptimizedErasableTypeWrappers.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 764 | 9640ddc9a5b0a02919579646be1797a7676f87a5d71109923f7351d4d7e4cc96 | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --optimize-erasable-datatype-wrapper:false --relax-definite-assignment --spill-translation
datatype SingletonRecord = SingletonRecord(u: int)
datatype WithGhost = WithGhost(u: int, ghost v: int)
method Main() {
var s := SingletonRecord(15);
va... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Variance.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 5,066 | 046ac207b2349cb620f60a0a2e1261d15b776a967b1ddccbc8e2dc72c39b259d | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --allow-deprecation
datatype Co<+T> = Co(z: T) {
const x: int;
const y: seq<T>
function A(x: T): int { 0 }
static function sA(x: T): int { 0 }
function gA(ghost x: T): int { 0 }
function B(x: s... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Various.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 869 | 6fc916c99e93879d325c5b23d4d15c8ffcdd5280e1277ecddb703dc72bf03620 | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment
method Match(tp: (nat, nat)) {
match tp
case (0, _) => print "match", "\n";
case _ =>
}
method {:tailrecursion true} Countdown(x: nat) {
label here: {
if x == 0 {
print "Kablammo!!\n";
} else... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/concurrency/01-InnerOuter.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 4,456 | 475c369fd516bd7f7e77cd56e84acd03718193e4258591c19f3508b30fbcea11 | // RUN: %testDafnyForEachResolver "%s"
// This program shows how to model an outer type whose invariant refers to the invariant of an inner type.
// A universe of objects playing under LCI rules
trait S extends object {
// The set of objects in the universe
ghost var obs: set<O>
// Workaround Dafny... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/concurrency/02-DoubleRead.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 7,354 | e7da8cd3e8c59b9b80bef394e03417cde48a0bfb9a6791b4de649141d0fbbe05 | // RUN: %testDafnyForEachResolver "%s"
// This program shows how to model a program that reads twice from a shared non-decreasing counter.
// This encoding requires the user to provide an invariant for each program point.
//
// Rust-life source code:
// fn worker(counter: Arc<AtomicIsize>) {
// let initial_... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/concurrency/03-SimpleCounter.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 7,788 | d3463f0858e6333b3c237e44db65d60bb27887301ee2d3c072dae6654e637ec0 | // RUN: %testDafnyForEachResolver "%s"
// This program shows how to model a program that reads and modifies a shared non-decreasing counter.
// This encoding requires the user to provide an invariant for each program point.
//
// Rust-life source code:
// fn worker(counter: Arc<AtomicIsize>) {
// let initia... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/concurrency/04-LeastGreatest.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 2,183 | 052aff91128a599bfee7eb489a39ed7a72d40f05c5e03efdda3afac3fc4160ba | // RUN: %testDafnyForEachResolver "%s"
// Simple least predicate
// Note: `least predicate P(x: int) { true && P(x) }` would be equivalent to `false`.
least predicate P(x: int) {
x == 123 || P(x)
}
lemma BuildP(x: int) requires x == 123 ensures P(x) {}
// Simple greatest predicate
greatest predi... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/concurrency/05-RecInvariantCut.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 6,401 | 1d211e0275b479efe8de0bd43a75379b12ab42fae82296588cb954d017bc9665 | // RUN: %testDafnyForEachResolver "%s"
// This program shows how to model two types A and B with mutually recursive invariants.
// Cast a trait type to an object type.
// Dafny doesn't allow to do reference equality between a trait and an object type, so we use this function to upcast where needed.
ghost func... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/concurrency/06-ThreadOwnership.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 19,346 | f4de89ffe3e2a8d9cc962b2a098aadd4f50090016453b9598c6141d61b69337b | // RUN: %testDafnyForEachResolver "%s"
// This program shows how to encode ownership and the property that objects owned by a thread that doesn't execute don't change.
// A universe of objects playing under LCI rules
trait Universe extends object {
// The set of objects in the universe
ghost var content:... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/concurrency/07-CounterThreadOwnership.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 40,035 | a75f087a13461349bad8bb837c570722b459d37d4412199047768883b1aaa40e | // RUN: %testDafnyForEachResolver "%s"
// This program shows how to model a program that concurrently increments a counter by a fixed amount.
// This encoding requires the user to provide an invariant for each program point.
//
// Rust-like source code:
// fn incrementer(counter: Arc<AtomicIsize>, remaining: A... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/concurrency/08-CounterNoTermination.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 26,485 | 230b962a0b1b70899f705ebdf58316b44a0b8f7a074a567ac113239d8705a6d0 | // RUN: %testDafnyForEachResolver "%s"
// This program shows how to model a program that concurrently increments a counter by a fixed amount.
// This encoding requires the user to provide an invariant for each program point.
//
// Rust-like source code:
// fn incrementer(counter: Arc<AtomicIsize>, remaining: A... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/concurrency/09-CounterNoStateMachine.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 33,397 | 5f2c4283a707f6effe57cc76f9e56d75351f2946d11c2ead584fd68b18e4024a | // RUN: %testDafnyForEachResolver "%s"
// This program shows how to model a program that concurrently increments a counter by a fixed amount.
//
// Rust-like source code:
// fn incrementer(counter: Arc<AtomicIsize>, remaining: &mut isize)
// requires *remaining == 10
// ensures *remaining == 0
// {
// ... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/concurrency/10-SequenceInvariant.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 30,826 | e23717abc56d311e1767ddc3ffe450b0b95ff67d37902953589a6010a3cde8d6 | // RUN: %testDafnyForEachResolver "%s"
// This program shows how to model a program that concurrently increments a counter
// The encoding used using sequential code and claims.
// A universe of objects playing under LCI rules
trait Universe extends object {
// The set of objects in the universe
var con... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/concurrency/11-MutexGuard2.legacy.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 30,769 | d6056bc3b333bbfd79e4950d2dd79676e17dfd161bf36df59238ad41c6addb47 | // UNSUPPORTED: windows,posix
// RUN: %dafny /compile:0 /proverOpt:O:smt.qi.eager_threshold=30 /typeEncoding:p "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
// This program models the ownership of a Rust-like MutexGuard.
// To speed up the verification: /vcsLoad:0.5 /proverOpt:O:smt.qi.eager_threshold=30
// A uni... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/concurrency/12-MutexLifetime-long.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 58,317 | d6ce6480b51445e6d3e585dc5197fc6fdb8689047af3d201cde7e1a430c907d5 | // UNSUPPORTED: windows,posix
// RUN: %verify --solver-option="O:smt.qi.eager_threshold=30" "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
// This program models the ownership of a Rust-like MutexGuard using lifetimes to reason about allocation.
// To speed up the verification: /vcsLoad:0.5 /proverOpt:O:smt.qi.eager_... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/concurrency/12-MutexLifetime-short.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 43,149 | c4e23e66d07e8a676e6bbe291b5776e704093e5f223a76b681c9b06a0cffadce | // RUN: %verify --allow-axioms "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
// This program models the ownership of a Rust-like MutexGuard using lifetimes to reason about allocation.
// To speed up the verification: /vcsLoad:0.5 /proverOpt:O:smt.qi.eager_threshold=30
// A universe of objects playing under LCI rul... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/contract-wrappers/AllExterns.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 431 | 72fdee6d5fe7a7adb09febb1239196e9bf3e91c105ebfca7f1c4b621cba226ca | // RUN: ! %baredafny test %args --allow-warnings --test-assumptions=externs %s %s.externs.cs > %t
// RUN: %diff "%s.expect" "%t"
// RUN: %OutputCheck --file-to-check "%S/AllExterns.cs" "%s"
// CHECK: .*Foo____dafny__checked\(x\).*
// CHECK: .*Foo____dafny__checked\(new BigInteger\(3\)\).*
// CHECK: .*Bar____dafny_... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/contract-wrappers/RefineContract.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 466 | 83071fb50c63c3435a631e99154bbb3dff2c3912f187d2b81de177d29c0225c2 | // RUN: %run "%s" --input "%S/AbstractExtern1.cs" --allow-external-contracts --test-assumptions Externs > %t
// RUN: %exits-with 3 %run "%s" --input "%S/AbstractExtern2.cs" --allow-external-contracts --test-assumptions Externs >> %t
// RUN: %diff "%s.expect" "%t"
abstract module A {
method {:extern "ExternMetho... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/contract-wrappers/TestedExterns.legacy.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 546 | 07f22305ab3c0215cc4a53a5343281f17a6a69452e62cd60d98856f3b1c4ea66 | // RUN: ! %dafny /compile:4 /runAllTests:1 /spillTargetCode:3 /testContracts:TestedExterns %s %s.externs.cs > %t
// RUN: %diff "%s.expect" "%t"
// RUN: %OutputCheck --file-to-check "%S/TestedExterns.legacy.cs" "%s"
// CHECK-NOT: .*Foo____dafny__checked\(x\).*
// CHECK: .*Foo____dafny__checked\(new BigInteger\(3\)\)... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/AdvancedLHS.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,436 | a134ca10e9199adeaedcfcf4c50f6386f81b71624bd98cc3027d7da5612e0858 | // RUN: %testDafnyForEachResolver --expect-exit-code=4 "%s"
class C {
var x: C?
method M(S: set<C>, a: array<C>, b: array2<C>)
requires S != {}
modifies this, a, b
{
x := new C;
x := new C.Init();
x := *;
// test evaluation order
var c := x;
x := null;
x :=... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/AllLiteralsAxiom.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 700 | 9c511c02c5ac6198eb7333619fa617b0c324890614358b8a4d44ecbc59ca9e5f | // RUN: %verify --solver-option="O:smt.qi.eager_threshold=30" "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
module NeedsAllLiteralsAxiom {
// The following test shows that there exist an example that
// benefits from the all-literals axiom. (It's not clear how
// important such an example is, nor is it clear... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/AndOrAmbiguity.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 2,236 | f373ab79f3e489747b4f360d0dabe401fedb332f052871b301f435fc4ae39824 | // RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s"
// && and || have the same binding power and do not associate with each other.
// The same goes for ==> and <==, and for &, |, and ^.
// The tests below check that these ambiguities result in understandable error message.
method M0() returns (A: bool... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/ApproximateExactLiterals.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 2,044 | 0ce6922bf109dc758e4ce92caf18a5c44745206cbc298aaf34522ffd62594a15 | // RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s"
method TestTildeOnExactFp32Literals() {
// ERROR: Using ~ on exactly representable values is forbidden
// The ~ prefix is only for acknowledging inexact representation
var bad1: fp32 := ~1.0; // Error: ~ not allowed; 1.0 is exactly representabl... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/Array.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 9,432 | ede49647cd20f3fe08f0e4358b10505d7b303125233ae3c424c8ca313658ef15 | // RUN: %exits-with 4 %verify --print-ranges --relax-definite-assignment --allow-axioms --manual-triggers "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
class A {
method M() {
var y := new A?[100];
y[5] := null;
}
method N0() {
var a: array<int>;
if 5 < a.Length {
a[5] := 12; // e... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/ArrayElementInit.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 4,194 | 5957b821e14f56ea9dd145573ae6d898fabcebe8a1330fc8e3a8d681538a6847 | // RUN: %exits-with 4 %verify "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
method M0(d: int)
{
var a := new int[25](_ => d);
assert a.Length == 25;
assert a[18] == d;
}
method M1(d: int)
{
var a := new int[25](_ => 10 / d); // error: possible division by 0
assert a.Length == 25;
}
method M2(... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/ArrayElementInitCompile.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 3,766 | 5a358006de24d1d8088b94b9ffa81398b111809a27d07c9554a23c93749297ca | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment
method Main()
{
var a := SingleValued(67);
PrintArray(a);
var mx := NewMatrix();
PrintMatrix(mx);
var c := InitArray(F);
PrintArray(c);
var s := InitArray(_ => 12);
PrintArray(s);
var t := ... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/ArrayElementInitResolution.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 3,238 | 6a374a1669fa40f3c05bf3dcf953490d5ca51a9f31f8a9f9337311be4ede50d2 | // RUN: %exits-with 2 %verify --type-system-refresh=false --general-newtypes=false "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
module AM {
method M0(d: int)
{
var a := new int[25](_ => d);
assert a.Length == 25;
assert a[18] == d;
}
method M1()
{
var f := (r: real) => r;
v... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/AsIs-Resolve.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 10,621 | df5d0a6bd12542c908197602be89dd1bf3af1a48bbbcc2c48b781c231cb1a010 | // RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s"
module Types {
trait A<X> extends object { }
trait B<X> extends object { }
trait C<Y> extends A<seq<Y>> { }
trait D<Z> extends B<int>, C<Z> { }
class K<X> { }
class L<Y> extends A<Y> { }
class M<W> extends D<(W, W)> { }
type Opaque... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/AsIs-SimplifiedExpanded-Resolve.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 18,299 | 30919002e90f773bdedb53730f9fef817cbae19755794c22f7ffde1e439287d6 | // RUN: %exits-with 2 %verify "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
method IsBasicTypes(a0: bool, a1: char, a2: int, a3: bv7, a4: bv13, a5: ORDINAL, a6: real)
{
if
case true =>
var _ := a0 is bool;
var _ := a0 is char; // error
var _ := a0 is int; // error
var _ := a0 is bv7; // erro... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/AsIs-UnusedTypeParameters.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 2,461 | 1f6a35eebf08299afcc7eace1eadab873906675375a1404f4d2837a0c5dca91f | // RUN: %testDafnyForEachResolver --expect-exit-code=2 --refresh-exit-code=4 "%s"
module UnusedTypeParametersOfSubtypeTypes {
trait T<X> { }
class D<X1> extends T<(int, seq<X1>)> { }
type F<X2, Unused> = d: D<X2> | true witness * // the legacy resolver treats F as a reference type, and bogusly wants all par... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/AsIs-Verify.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 811 | 80dda6b71996c0a4baa1752e56e3c389e48875b9743408091b8f61dc13e54a29 | // RUN: %exits-with 4 %verify "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
type pos = x | 1 <= x witness 3
method ImplicitConversions(f: bool ~> nat) {
var g: bool ~> int := f;
var h: bool ~> pos := f; // error (case in point: f(true) may be 0)
}
method CompareRegression(f: bool ~> nat) {
var g := f... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/AsIs.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 3,910 | da7342d7118b609116867761ba4a35c19f9cda0bfc69a094624167cd3a026fa8 | // RUN: %testDafnyForEachResolver --expect-exit-code=4 --refresh-exit-code=2 "%s"
trait A<X> extends object { }
trait B<Y0, Y1> extends object { }
trait C<Z> extends B<int, Z> { }
class K<U> extends object, B<int, U> { }
class L<V> extends C<V> { }
method AssignBackAndForth<W>(a: A<W>, b: B<int, W>, c: C<... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/AsIsAgain.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 3,675 | 012f4a8d9f1124cfd8fea7f2bcbec24424e626a3890a9996526f352a183112aa | // RUN: %testDafnyForEachResolver --expect-exit-code=4 "%s"
// This file is like AsIs.dfy, but has explicit type casts in AssignBackAndForth, as required by the new type system.
trait A<X> extends object { }
trait B<Y0, Y1> extends object { }
trait C<Z> extends B<int, Z> { }
class K<U> extends object, B<int, U... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/Assigned.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 663 | d619b3d123a4f3d6bcaf669c3078845326d9b8cd15a27fc386c1225dc277afe1 | // RUN: %verify --relax-definite-assignment "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
class C<G>
{
var x: G
const y: G
constructor Con0(i: int, a: G, b: G)
{
x := a;
y := b;
assert assigned(x);
assert assigned(y);
new;
if i > 0 {
x := y;
}
}
con... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/AssumptionVariables0.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 2,118 | 5d0d29c4fabf38f342d24db1ad7c8928e23e7689adfd8fb8fc796cb568b7e171 | // RUN: %exits-with 2 %verify "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
module UsageTests {
method test0(x: int)
{
ghost var {:assumption} a0 := false; // error
ghost var a1, {:assumption} a2 := true, false; // error
ghost var {:assumption} a3: bool;
ghost var {:assumption} a4: bool; /... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/AssumptionVariables1.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 610 | 71eefc112a8beaa6a06e4ce22d5fb426375e2a24853599b24536f145c5ebc6aa | // RUN: %verify --relax-definite-assignment --boogie=/print:%t.bprint --print="%t.print" "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
method test0(x: int)
{
ghost var {:assumption} a0: bool;
ghost var {:assumption} a1: bool, a2: bool, {:assumption} a3: bool;
assert a0 && a1 && a3;
a0 := a0 && (0 < x)... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/AttributeChecks.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 18,387 | cc2da70a12ad60a67d916be5f3cfef4829b94cfe93f6b394c35303a32a42bd7f | // RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s" -- --print=- --reads-clauses-on-methods
module JustAboutEverything {
method If(n: int) returns (k: int)
{
var i := 0;
if {:split true} i < n {
if {:split 1 + 0} true {}
}
else if {:split false} i > n {}
else {:split t... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/AutoContracts.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,988 | 8625329e91d32292a78b386521d50f1b20f1365bc733e135ada4991e7eb0b2a8 | // RUN: %testDafnyForEachResolver --expect-exit-code=4 "%s" -- --rprint:-
module OneModule {
class {:autocontracts} D { }
class {:autocontracts} C {
var data: int
var anotherC: C?
var dd: D?
var {:autocontracts false} ee: D?
var arr: array?<C?>
ghost predicate Valid()
{
... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/AutoReq.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 6,435 | f2171725418b709c353ed442a0f24173350f620a96f9b7e2a482f981d6c71ff3 | // RUN: %testDafnyForEachResolver --expect-exit-code=4 "%s" -- --allow-deprecation
ghost function f(x:int) : bool
requires x > 3;
{
x > 7
}
// Should cause a function-requires failure
ghost function g(y:int) : bool
{
f(y)
}
// Should succeed thanks to auto-generation based on f's requirements
... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/Backticks.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,104 | 02b648f2528075d0a0dd21a728766b5439dcb90001d6f324440f4ef5cc9751b2 | // RUN: %testDafnyForEachResolver --expect-exit-code=4 "%s"
class C {
var x: int
var y: int
ghost var z: int
ghost function F(): int
reads `x
{
x
}
ghost function G(): int
reads `x
{
F()
}
ghost function H(): int
reads this
{
F()
}
ghost ... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/BadFunction.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 446 | 51b97e5ce736aacccef7d18d82485f229edd1709412738ff380de49b3c6a4c20 | // RUN: %testDafnyForEachResolver --expect-exit-code=4 "%s"
// The following function gives rise to an inconsistent axiom, except
// for its CanUseFunctionDefs antecedent, which saves the day.
ghost function F(x: int): int
decreases x
{
F(x) + 1 // error: does not decrease termination metric
}
method... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/Basics.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 19,370 | 913cf455cf8e40f33f8c97ad80aabb59377b048d77eb9d2cffab9f438d1a779f | // RUN: %exits-with 4 %verify --relax-definite-assignment --allow-axioms --allow-deprecation "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
class Global {
static ghost function G(x: int): int { x+x }
static method N(ghost x: int) returns (ghost r: int)
ensures r == Global.G(x)
{
if {
case true... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/BigOrdinals.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 3,257 | be31d9a155d8ee1c2e58ff1cf5e3ee83564aa86e421bb42d207260b2f08b6867 | // RUN: %exits-with 4 %verify --relax-definite-assignment "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
method M(o: ORDINAL) returns (p: ORDINAL)
ensures p == o
{
var five := 5;
p := five;
p := o;
}
method As(o: ORDINAL, x: int) returns (p: ORDINAL, y: int)
{
if
case 0 <= x =>
p := x as OR... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/BindingGuards.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 5,313 | e11ead439169bc53d4fdbfad6f0f58f0b70ba57f300c023447961475905b7779 | // RUN: %testDafnyForEachResolver --expect-exit-code=4 "%s" -- --relax-definite-assignment --print:-
ghost predicate P(n: int)
{
n % 2 == 0
}
ghost predicate R(r: real)
{
0.0 <= r
}
method M0()
{
if x :| P(x) {
var y := x + 3;
}
}
method M1()
{
if x: int :| P(x) {
}
}
met... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/BindingGuardsResolution.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 3,607 | feddff1e01be220ee3c1f70ecce309fe7b7dd45614208ff06967df2f0a5e3b8e | // RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s" -- --print=-
module Tests {
ghost predicate P(n: int)
ghost predicate R(r: real)
method M0()
{
if x :| P(x) {
var y := x + 3;
var x := true; // error: 'x' is already declared in this scope
}
}
method M1()
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.