// #target: macos-x64
module foo;
struct Foo
{
	int a;
}
struct Bar
{
	inline Foo f;
}
fn void main()
{
	assert(Foo.parentof == void.typeid);
	assert(Bar.parentof == Foo.typeid);
	typeid x = Foo.typeid;
	assert(x.parentof == void.typeid);
	x = Bar.typeid;
	assert(x.parentof == Foo.typeid);
}

/* #expect: foo.ll

@"$ct.foo.Foo" = linkonce global %.introspect { i8 10, i64 0, ptr null, i64 4, i64 0, i64 1, [0 x i64] zeroinitializer }, align 8
@"$ct.foo.Bar" = linkonce global %.introspect { i8 10, i64 ptrtoint (ptr @"$ct.foo.Foo" to i64), ptr null, i64 4, i64 0, i64 1, [0 x i64] zeroinitializer }, align 8
@"$ct.void" = linkonce global %.introspect { i8 0, i64 0, ptr null, i64 1, i64 0, i64 0, [0 x i64] zeroinitializer }, align 8

; Function Attrs:
define void @foo.main() #0 {
entry:
  %x = alloca i64, align 8
  store i64 ptrtoint (ptr @"$ct.foo.Foo" to i64), ptr %x, align 8
  %0 = load i64, ptr %x, align 8
  %"introspect*" = inttoptr i64 %0 to ptr
  %ptradd = getelementptr inbounds i8, ptr %"introspect*", i64 8
  %typeid.parent = load i64, ptr %ptradd, align 8
  %1 = icmp eq i64 %typeid.parent, 0
  %2 = select i1 %1, i64 ptrtoint (ptr @"$ct.void" to i64), i64 %typeid.parent
  %eq = icmp eq i64 %2, ptrtoint (ptr @"$ct.void" to i64)
  call void @llvm.assume(i1 %eq)
  store i64 ptrtoint (ptr @"$ct.foo.Bar" to i64), ptr %x, align 8
  %3 = load i64, ptr %x, align 8
  %"introspect*1" = inttoptr i64 %3 to ptr
  %ptradd2 = getelementptr inbounds i8, ptr %"introspect*1", i64 8
  %typeid.parent3 = load i64, ptr %ptradd2, align 8
  %4 = icmp eq i64 %typeid.parent3, 0
  %5 = select i1 %4, i64 ptrtoint (ptr @"$ct.void" to i64), i64 %typeid.parent3
  %eq4 = icmp eq i64 %5, ptrtoint (ptr @"$ct.foo.Foo" to i64)
  call void @llvm.assume(i1 %eq4)
  ret void
}