Skip to content

Commit 349a32a

Browse files
committed
add dependency analysis test case
1 parent 5d6631b commit 349a32a

2 files changed

Lines changed: 6 additions & 10 deletions

File tree

‎src/main/scala/viper/gobra/backend/ViperBackends.scala‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@ trait ViperBackend {
3939
SIFExtendedTransformer.Config.enableGotoLowEventEncoding = true
4040
}
4141

42-
options ++= Vector("--disableTerminationPlugin")
42+
// options ++= Vector("--disableTerminationPlugin")
4343
options
4444
}
4545
}
4646

4747
trait SiliconBasedBackend extends ViperBackend {
4848
override protected def buildOptions(exePaths: Vector[String], config: Config): Vector[String] = {
4949
var options: Vector[String] = super.buildOptions(exePaths, config)
50-
options ++= Vector("--logLevel", "ERROR")
50+
// options ++= Vector("--logLevel", "ERROR")
5151
options ++= Vector("--disableCatchingExceptions")
5252
if (config.conditionalizePermissions) {
5353
options ++= Vector("--conditionalizePermissions")

‎src/test/resources/dependencyAnalysis/test1.gobra‎

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
package test1
12

23
func testBranches(a bool){
34
@dependencyInfo("assumptionType:SourceCode, label:L0, expectedDependencies:[]")
@@ -13,7 +14,7 @@ func testBranches(a bool){
1314
@dependencyInfo("assertionType:Explicit, label:L5, expectedDependencies:[L1]")
1415
assert !a
1516
}
16-
@dependencyInfo("assertionType:Explicit, label:L6, expectedDependencies:[L2, L4, L1, L3]")
17+
@dependencyInfo("assertionType:Explicit, label:L6, expectedDependencies:[L2, L4]")
1718
assert x > 0
1819
}
1920

@@ -34,26 +35,21 @@ requires @dependencyInfo("assumptionType:Precondition, label:L11, expectedDepend
3435
requires @dependencyInfo("assumptionType:Precondition, label:L12, expectedDependencies:[]")(a < 100)
3536
ensures @dependencyInfo("assertionType:ImplicitPostcondition, label:L13, expectedDependencies:[L11, L14]")(res > 0)
3637
pure func add_one(a int) (res int){
37-
return @dependencyInfo("assumptionType:SourceCode, label:L14, expectedDependencies:[]")(a + 1)
38+
return @dependencyInfo("assumptionType:FunctionBody, label:L14, expectedDependencies:[]")(a + 1)
3839
}
3940

40-
const TEN = @dependencyInfo("assumptionType:SourceCode, label:L15, expectedDependencies:[]")(10)
41-
4241
func client() {
4342
@dependencyInfo("assumptionType:SourceCode, label:L16, expectedDependencies:[]")
4443
a := 30
4544

4645
@dependencyInfo("assumptionType:SourceCode, label:L17, expectedDependencies:[L16]")
4746
res := add_one(a)
48-
@dependencyInfo("assertionType:Explicit, label:L18, expectedDependencies:[L13,L11,L14,L17,L16]")
47+
@dependencyInfo("assertionType:Explicit, label:L18, expectedDependencies:[L16,L14,L17]")
4948
assert res > 0
5049

5150

5251
@dependencyInfo("assumptionType:SourceCode, label:L19, expectedDependencies:[L16]")
5352
res2 := bar(a)
5453
@dependencyInfo("assertionType:Explicit, label:L20, expectedDependencies:[L16,L19,L8,L7,L9,L9b]")
5554
assert res2 > 0
56-
57-
@dependencyInfo("assertionType:Explicit, label:L21, expectedDependencies:[L15]")
58-
assert TEN == 10
5955
}

0 commit comments

Comments
 (0)