-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test to check substitution of ctor nodes.
- Loading branch information
Showing
2 changed files
with
46 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. | ||
[debug/ast-final] # [HILTI] Test: Final AST (round 1) | ||
[debug/ast-final] - Module %4 (ctor-replacement.hlt:6:1-12:2) [@m:XXX] | ||
[debug/ast-final] | Test -> declaration::Module %6 <id="Test"> [canon-id: Test] [@d:XXX] ([@d:XXX]) | ||
[debug/ast-final] | x -> declaration::GlobalVariable %1 <linkage="private"> [canon-id: Test::x] [@d:XXX] ([@d:XXX]) | ||
[debug/ast-final] | y -> declaration::GlobalVariable %2 <linkage="private"> [canon-id: Test::y] [@d:XXX] ([@d:XXX]) | ||
[debug/ast-final] | z -> declaration::GlobalVariable %3 <linkage="private"> [canon-id: Test::z] [@d:XXX] ([@d:XXX]) | ||
[debug/ast-final] - ID <name="Test"> (ctor-replacement.hlt:6:8) [@i:XXX] | ||
[debug/ast-final] - statement::Block (ctor-replacement.hlt:6:1-12:2) [@s:XXX] | ||
[debug/ast-final] - declaration::GlobalVariable %1 <linkage="private"> (ctor-replacement.hlt:6:14-8:22) [canon-id: Test::x] [@d:XXX] | ||
[debug/ast-final] - ID <name="x"> (ctor-replacement.hlt:8:8) [@i:XXX] | ||
[debug/ast-final] - node::None (ctor-replacement.hlt:6:14-8:22) [@n:XXX] | ||
[debug/ast-final] - expression::Ctor (ctor-replacement.hlt:8:12) (const) (resolved) [@e:XXX] | ||
[debug/ast-final] - ctor::SignedInteger <value="-1" width="32"> (ctor-replacement.hlt:8:12) [@c:XXX] | ||
[debug/ast-final] - type::SignedInteger <width="32"> (const) (resolved) [@t:XXX] | ||
[debug/ast-final] - declaration::GlobalVariable %2 <linkage="private"> (ctor-replacement.hlt:8:22-9:22) [canon-id: Test::y] [@d:XXX] | ||
[debug/ast-final] - ID <name="y"> (ctor-replacement.hlt:9:8) [@i:XXX] | ||
[debug/ast-final] - node::None (ctor-replacement.hlt:6:14-8:22) [@n:XXX] | ||
[debug/ast-final] - expression::Ctor (ctor-replacement.hlt:9:12) (const) (resolved) [@e:XXX] | ||
[debug/ast-final] - ctor::UnsignedInteger <value="1" width="32"> (ctor-replacement.hlt:9:12) [@c:XXX] | ||
[debug/ast-final] - type::UnsignedInteger <width="32"> (const) (resolved) [@t:XXX] | ||
[debug/ast-final] - declaration::GlobalVariable %3 <linkage="private"> (ctor-replacement.hlt:9:22-10:15) [canon-id: Test::z] [@d:XXX] | ||
[debug/ast-final] - ID <name="z"> (ctor-replacement.hlt:10:8) [@i:XXX] | ||
[debug/ast-final] - node::None (ctor-replacement.hlt:6:14-8:22) [@n:XXX] | ||
[debug/ast-final] - expression::Ctor (ctor-replacement.hlt:10:12) (const) (resolved) [@e:XXX] | ||
[debug/ast-final] - ctor::SignedInteger <value="-1" width="64"> (ctor-replacement.hlt:10:12) [@c:XXX] | ||
[debug/ast-final] - type::SignedInteger <width="64"> (ctor-replacement.hlt:10:12) (const) (resolved) [@t:XXX] | ||
module Test { | ||
|
||
global int<32> x = int32(-1); | ||
global uint<32> y = uint32(1); | ||
global int<64> z = -1; | ||
|
||
} |
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,12 @@ | ||
# @TEST-EXEC: hiltic -p -D ast-final %INPUT >output 2>&1 | ||
# @TEST-EXEC: btest-diff output | ||
# | ||
# @TEST-DOC: Check that the constant folder replaces constant expressions with corresponding ctor nodes, and that the printer round-trips the result. | ||
|
||
module Test { | ||
|
||
global x = int32(-1); | ||
global y = uint32(1); | ||
global z = -1; # int64 | ||
|
||
} |