• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
2target triple = "x86_64-grtev4-linux-gnu"
3
4%struct.B2 = type { %struct.A2 }
5%struct.A2 = type { i32 (...)** }
6%struct.B3 = type { %struct.A3 }
7%struct.A3 = type { i32 (...)** }
8
9@_ZTV1B2 = constant { [3 x i8*] } { [3 x i8*] [i8* undef, i8* undef, i8* undef] }, !type !0
10
11@_ZTV1B3 = constant { [3 x i8*] } { [3 x i8*] [i8* undef, i8* undef, i8* undef] }, !type !1
12
13define void @test2(i8* %b) {
14entry:
15  %0 = bitcast i8* %b to i8**
16  %vtable2 = load i8*, i8** %0
17  %1 = tail call i1 @llvm.type.test(i8* %vtable2, metadata !"_ZTS1A2")
18  br i1 %1, label %cont, label %trap
19
20trap:
21  tail call void @llvm.trap()
22  unreachable
23
24cont:
25  ret void
26}
27
28define void @test1(i8* %b) {
29entry:
30  %0 = bitcast i8* %b to i8**
31  %vtable2 = load i8*, i8** %0
32  %1 = tail call i1 @llvm.type.test(i8* %vtable2, metadata !"_ZTS1A3")
33  br i1 %1, label %cont, label %trap
34
35trap:
36  tail call void @llvm.trap()
37  unreachable
38
39cont:
40  ret void
41}
42
43@test3 = hidden unnamed_addr alias void (i8*), void (i8*)* @test1
44
45declare i1 @llvm.type.test(i8*, metadata)
46declare void @llvm.trap()
47
48!0 = !{i64 16, !"_ZTS1A2"}
49!1 = !{i64 16, !"_ZTS1A3"}
50