blob: 9f877fcc0f93ab2c8d5870e14b1b73a83dcac3e0 [file] [log] [blame]
Peter Collingbourneb15a35e2017-09-11 22:34:42 +00001; RUN: opt -mtriple=x86_64-unknown-linux-gnu -wholeprogramdevirt -wholeprogramdevirt-summary-action=export -wholeprogramdevirt-read-summary=%S/Inputs/export.yaml -wholeprogramdevirt-write-summary=%t -S -o - %s | FileCheck --check-prefixes=CHECK,X86 %s
2; RUN: FileCheck --check-prefixes=SUMMARY,SUMMARY-X86 %s < %t
3
4; RUN: opt -mtriple=armv7-unknown-linux-gnu -wholeprogramdevirt -wholeprogramdevirt-summary-action=export -wholeprogramdevirt-read-summary=%S/Inputs/export.yaml -wholeprogramdevirt-write-summary=%t -S -o - %s | FileCheck --check-prefixes=CHECK,ARM %s
5; RUN: FileCheck --check-prefixes=SUMMARY,SUMMARY-ARM %s < %t
Peter Collingbourne14dcf022017-03-10 20:13:58 +00006
7target datalayout = "e-p:64:64"
Peter Collingbourne14dcf022017-03-10 20:13:58 +00008
9; SUMMARY: TypeIdMap:
10; SUMMARY-NEXT: typeid3:
11; SUMMARY-NEXT: TTRes:
12; SUMMARY-NEXT: Kind: Unsat
13; SUMMARY-NEXT: SizeM1BitWidth: 0
14; SUMMARY-NEXT: WPDRes:
15; SUMMARY-NEXT: 0:
16; SUMMARY-NEXT: Kind: Indir
17; SUMMARY-NEXT: SingleImplName: ''
18; SUMMARY-NEXT: ResByArg:
19; SUMMARY-NEXT: 12,24:
20; SUMMARY-NEXT: Kind: VirtualConstProp
21; SUMMARY-NEXT: Info: 0
Peter Collingbourneb15a35e2017-09-11 22:34:42 +000022; SUMMARY-X86-NEXT: Byte: 0
23; SUMMARY-X86-NEXT: Bit: 0
24; SUMMARY-ARM-NEXT: Byte: 4294967295
25; SUMMARY-ARM-NEXT: Bit: 1
Peter Collingbourne14dcf022017-03-10 20:13:58 +000026; SUMMARY-NEXT: typeid4:
27; SUMMARY-NEXT: TTRes:
28; SUMMARY-NEXT: Kind: Unsat
29; SUMMARY-NEXT: SizeM1BitWidth: 0
30; SUMMARY-NEXT: WPDRes:
31; SUMMARY-NEXT: 0:
32; SUMMARY-NEXT: Kind: Indir
33; SUMMARY-NEXT: SingleImplName: ''
34; SUMMARY-NEXT: ResByArg:
35; SUMMARY-NEXT: 24,12:
36; SUMMARY-NEXT: Kind: VirtualConstProp
37; SUMMARY-NEXT: Info: 0
Peter Collingbourneb15a35e2017-09-11 22:34:42 +000038; SUMMARY-X86-NEXT: Byte: 0
39; SUMMARY-X86-NEXT: Bit: 0
40; SUMMARY-ARM-NEXT: Byte: 4294967292
41; SUMMARY-ARM-NEXT: Bit: 1
Peter Collingbourne14dcf022017-03-10 20:13:58 +000042
43; CHECK: [[CVT3A:.*]] = private constant { [8 x i8], i1 (i8*, i32, i32)*, [0 x i8] } { [8 x i8] zeroinitializer, i1 (i8*, i32, i32)* @vf0i1, [0 x i8] zeroinitializer }, !type !0
44@vt3a = constant i1 (i8*, i32, i32)* @vf0i1, !type !0
45
46; CHECK: [[CVT3B:.*]] = private constant { [8 x i8], i1 (i8*, i32, i32)*, [0 x i8] } { [8 x i8] c"\00\00\00\00\00\00\00\01", i1 (i8*, i32, i32)* @vf1i1, [0 x i8] zeroinitializer }, !type !0
47@vt3b = constant i1 (i8*, i32, i32)* @vf1i1, !type !0
48
49; CHECK: [[CVT3C:.*]] = private constant { [8 x i8], i1 (i8*, i32, i32)*, [0 x i8] } { [8 x i8] zeroinitializer, i1 (i8*, i32, i32)* @vf0i1, [0 x i8] zeroinitializer }, !type !0
50@vt3c = constant i1 (i8*, i32, i32)* @vf0i1, !type !0
51
52; CHECK: [[CVT3D:.*]] = private constant { [8 x i8], i1 (i8*, i32, i32)*, [0 x i8] } { [8 x i8] c"\00\00\00\00\00\00\00\01", i1 (i8*, i32, i32)* @vf1i1, [0 x i8] zeroinitializer }, !type !0
53@vt3d = constant i1 (i8*, i32, i32)* @vf1i1, !type !0
54
55; CHECK: [[CVT4A:.*]] = private constant { [8 x i8], i32 (i8*, i32, i32)*, [0 x i8] } { [8 x i8] c"\00\00\00\00\01\00\00\00", i32 (i8*, i32, i32)* @vf1i32, [0 x i8] zeroinitializer }, !type !1
56@vt4a = constant i32 (i8*, i32, i32)* @vf1i32, !type !1
57
58; CHECK: [[CVT4B:.*]] = private constant { [8 x i8], i32 (i8*, i32, i32)*, [0 x i8] } { [8 x i8] c"\00\00\00\00\02\00\00\00", i32 (i8*, i32, i32)* @vf2i32, [0 x i8] zeroinitializer }, !type !1
59@vt4b = constant i32 (i8*, i32, i32)* @vf2i32, !type !1
60
Peter Collingbourneb15a35e2017-09-11 22:34:42 +000061; X86: @__typeid_typeid3_0_12_24_byte = hidden alias i8, inttoptr (i32 -1 to i8*)
62; X86: @__typeid_typeid3_0_12_24_bit = hidden alias i8, inttoptr (i32 1 to i8*)
63; X86: @__typeid_typeid4_0_24_12_byte = hidden alias i8, inttoptr (i32 -4 to i8*)
64; X86: @__typeid_typeid4_0_24_12_bit = hidden alias i8, inttoptr (i32 1 to i8*)
65; ARM-NOT: alias {{.*}} inttoptr
Peter Collingbourne14dcf022017-03-10 20:13:58 +000066
67; CHECK: @vt3a = alias i1 (i8*, i32, i32)*, getelementptr inbounds ({ [8 x i8], i1 (i8*, i32, i32)*, [0 x i8] }, { [8 x i8], i1 (i8*, i32, i32)*, [0 x i8] }* [[CVT3A]], i32 0, i32 1)
68; CHECK: @vt3b = alias i1 (i8*, i32, i32)*, getelementptr inbounds ({ [8 x i8], i1 (i8*, i32, i32)*, [0 x i8] }, { [8 x i8], i1 (i8*, i32, i32)*, [0 x i8] }* [[CVT3B]], i32 0, i32 1)
69; CHECK: @vt3c = alias i1 (i8*, i32, i32)*, getelementptr inbounds ({ [8 x i8], i1 (i8*, i32, i32)*, [0 x i8] }, { [8 x i8], i1 (i8*, i32, i32)*, [0 x i8] }* [[CVT3C]], i32 0, i32 1)
70; CHECK: @vt3d = alias i1 (i8*, i32, i32)*, getelementptr inbounds ({ [8 x i8], i1 (i8*, i32, i32)*, [0 x i8] }, { [8 x i8], i1 (i8*, i32, i32)*, [0 x i8] }* [[CVT3D]], i32 0, i32 1)
71; CHECK: @vt4a = alias i32 (i8*, i32, i32)*, getelementptr inbounds ({ [8 x i8], i32 (i8*, i32, i32)*, [0 x i8] }, { [8 x i8], i32 (i8*, i32, i32)*, [0 x i8] }* [[CVT4A]], i32 0, i32 1)
72; CHECK: @vt4b = alias i32 (i8*, i32, i32)*, getelementptr inbounds ({ [8 x i8], i32 (i8*, i32, i32)*, [0 x i8] }, { [8 x i8], i32 (i8*, i32, i32)*, [0 x i8] }* [[CVT4B]], i32 0, i32 1)
73
74define i1 @vf0i1(i8* %this, i32, i32) readnone {
75 ret i1 0
76}
77
78define i1 @vf1i1(i8* %this, i32, i32) readnone {
79 ret i1 1
80}
81
82define i32 @vf1i32(i8* %this, i32, i32) readnone {
83 ret i32 1
84}
85
86define i32 @vf2i32(i8* %this, i32, i32) readnone {
87 ret i32 2
88}
89
90; CHECK: !0 = !{i32 8, !"typeid3"}
91; CHECK: !1 = !{i32 8, !"typeid4"}
92
93!0 = !{i32 0, !"typeid3"}
94!1 = !{i32 0, !"typeid4"}