Wrote test for getelementptr'ing into chained typedefs

This commit is contained in:
Sasha Koshka 2024-01-25 18:19:34 +00:00
parent 67a0157cbd
commit f6604dcecd

View File

@ -113,3 +113,26 @@ C: B
}
`)
}
func TestChainedTypedefGetElementPtr (test *testing.T) {
testString (test,
`%A = type { i64 }
%B = type %A
define void @main() {
0:
%1 = alloca %B
%2 = load %B, ptr %1
%3 = getelementptr { i64 }, ptr %1, i32 0, i32 0
store i64 5, ptr %3
ret void
}
`,
`
A: (x:Int)
B: A
[main] = {
b:B
b.x = 5
}
`)
}