Wrote test for getelementptr'ing into chained typedefs
This commit is contained in:
parent
67a0157cbd
commit
f6604dcecd
@ -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
|
||||
}
|
||||
`)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user