-
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.
fix annotation of adress-of expression
adress-of expressions now result in pointer-types that will be added dynamically to the index fixes #353
- Loading branch information
Showing
12 changed files
with
356 additions
and
86 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
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
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
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
22 changes: 22 additions & 0 deletions
22
...degen/tests/snapshots/rusty__codegen__tests__expression_tests__cast_lword_to_pointer.snap
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,22 @@ | ||
--- | ||
source: src/codegen/tests/expression_tests.rs | ||
expression: result | ||
|
||
--- | ||
; ModuleID = 'main' | ||
source_filename = "main" | ||
|
||
%baz_interface = type { i16*, i64 } | ||
|
||
define i16 @baz(%baz_interface* %0) { | ||
entry: | ||
%ptr_x = getelementptr inbounds %baz_interface, %baz_interface* %0, i32 0, i32 0 | ||
%y = getelementptr inbounds %baz_interface, %baz_interface* %0, i32 0, i32 1 | ||
%baz = alloca i16, align 2 | ||
%load_y = load i64, i64* %y, align 4 | ||
%1 = inttoptr i64 %load_y to i16* | ||
store i16* %1, i16** %ptr_x, align 8 | ||
%baz_ret = load i16, i16* %baz, align 2 | ||
ret i16 %baz_ret | ||
} | ||
|
22 changes: 22 additions & 0 deletions
22
...degen/tests/snapshots/rusty__codegen__tests__expression_tests__cast_pointer_to_lword.snap
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,22 @@ | ||
--- | ||
source: src/codegen/tests/expression_tests.rs | ||
expression: result | ||
|
||
--- | ||
; ModuleID = 'main' | ||
source_filename = "main" | ||
|
||
%baz_interface = type { i16*, i64 } | ||
|
||
define i16 @baz(%baz_interface* %0) { | ||
entry: | ||
%ptr_x = getelementptr inbounds %baz_interface, %baz_interface* %0, i32 0, i32 0 | ||
%y = getelementptr inbounds %baz_interface, %baz_interface* %0, i32 0, i32 1 | ||
%baz = alloca i16, align 2 | ||
%load_ptr_x = load i16*, i16** %ptr_x, align 8 | ||
%1 = ptrtoint i16* %load_ptr_x to i64 | ||
store i64 %1, i64* %y, align 4 | ||
%baz_ret = load i16, i16* %baz, align 2 | ||
ret i16 %baz_ret | ||
} | ||
|
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
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
Oops, something went wrong.