1 ; RUN: opt -S -lowertypetests < %s | FileCheck %s
3 target datalayout = "e-p:32:32"
5 ; Tests that this set of globals is laid out according to our layout algorithm
6 ; (see GlobalLayoutBuilder in include/llvm/Transforms/IPO/LowerTypeTests.h).
7 ; The chosen layout in this case is a, e, b, d, c.
9 ; CHECK: private constant { i32, [0 x i8], i32, [0 x i8], i32, [0 x i8], i32, [0 x i8], i32 } { i32 1, [0 x i8] zeroinitializer, i32 5, [0 x i8] zeroinitializer, i32 2, [0 x i8] zeroinitializer, i32 4, [0 x i8] zeroinitializer, i32 3 }
10 @a = constant i32 1, !type !0, !type !2
11 @b = constant i32 2, !type !0, !type !1
12 @c = constant i32 3, !type !0
13 @d = constant i32 4, !type !1
14 @e = constant i32 5, !type !2
16 !0 = !{i32 0, !"typeid1"}
17 !1 = !{i32 0, !"typeid2"}
18 !2 = !{i32 0, !"typeid3"}
20 declare i1 @llvm.type.test(i8* %ptr, metadata %bitset) nounwind readnone
23 %x = call i1 @llvm.type.test(i8* undef, metadata !"typeid1")
24 %y = call i1 @llvm.type.test(i8* undef, metadata !"typeid2")
25 %z = call i1 @llvm.type.test(i8* undef, metadata !"typeid3")