interp: add support for reading a pointer tag

This is necessary to get https://github.com/tinygo-org/tinygo/pull/3691
working.
This commit is contained in:
Ayke van Laethem
2023-05-20 17:28:13 +02:00
committed by Ron Evans
parent cf39db36fe
commit 481f60c5ea
3 changed files with 17 additions and 0 deletions
+8
View File
@@ -4,6 +4,7 @@ target triple = "x86_64--linux"
@intToPtrResult = global i8 0
@ptrToIntResult = global i8 0
@icmpResult = global i8 0
@pointerTagResult = global i64 0
@someArray = internal global {i16, i8, i8} zeroinitializer
@someArrayPointer = global ptr zeroinitializer
@@ -17,6 +18,7 @@ define internal void @main.init() {
call void @testPtrToInt()
call void @testConstGEP()
call void @testICmp()
call void @testPointerTag()
ret void
}
@@ -63,3 +65,9 @@ unequal:
ret void
ret void
}
define internal void @testPointerTag() {
%val = and i64 ptrtoint (ptr getelementptr inbounds (i8, ptr @someArray, i32 2) to i64), 3
store i64 %val, ptr @pointerTagResult
ret void
}