-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
80 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
tests/lit/single/property/called_inside_pou_where_defined.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// RUN: (%COMPILE %s && %RUN) | %CHECK %s | ||
|
||
FUNCTION_BLOCK A | ||
PROPERTY sayCheese : DINT | ||
GET | ||
printf('Cheese'); | ||
END_GET | ||
END_PROPERTY | ||
|
||
sayCheese; | ||
END_FUNCTION_BLOCK | ||
|
||
FUNCTION main | ||
VAR | ||
instanceA : A; | ||
END_VAR | ||
|
||
// CHECK: Cheese | ||
instanceA(); | ||
END_FUNCTION |
58 changes: 58 additions & 0 deletions
58
tests/lit/single/property/multiply_properties_single_pou.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// RUN: (%COMPILE %s && %RUN) | %CHECK %s | ||
|
||
FUNCTION_BLOCK A | ||
VAR | ||
foo : DINT; | ||
END_VAR | ||
|
||
PROPERTY increaseFooBy10 : DINT | ||
GET | ||
printf('Inside increaseFooBy10$N'); | ||
foo := foo + 10; | ||
END_GET | ||
END_PROPERTY | ||
|
||
PROPERTY increaseFooBy20 : DINT | ||
GET | ||
printf('Inside increaseFooBy20$N'); | ||
foo := foo + 20; | ||
END_GET | ||
END_PROPERTY | ||
|
||
PROPERTY increaseFooBy30 : DINT | ||
GET | ||
printf('Inside increaseFooBy30$N'); | ||
increaseFooBy20; | ||
increaseFooBy10; | ||
END_GET | ||
END_PROPERTY | ||
|
||
PROPERTY readFoo : DINT | ||
GET | ||
printf('Inside readFoo$N'); | ||
readFoo := foo; | ||
END_GET | ||
END_PROPERTY | ||
END_FUNCTION_BLOCK | ||
|
||
FUNCTION main | ||
VAR | ||
instanceA : A; | ||
result : DINT; | ||
END_VAR | ||
|
||
// CHECK: Inside increaseFooBy10 | ||
instanceA.increaseFooBy10; | ||
|
||
// CHECK: Inside increaseFooBy20 | ||
instanceA.increaseFooBy20; | ||
|
||
// CHECK: Inside increaseFooBy30 | ||
// CHECK: Inside increaseFooBy20 | ||
// CHECK: Inside increaseFooBy10 | ||
instanceA.increaseFooBy30; | ||
|
||
// CHECK: Inside readFoo | ||
// CHECK: 60 | ||
printf('%d$N', instanceA.readFoo); | ||
END_FUNCTION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters