aboutsummaryrefslogtreecommitdiff
path: root/llvm/test/Transforms/WholeProgramDevirt/export-unique-ret-val.ll
blob: deaf34651354d4ce067f7e54dbdb0972298c142a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
; RUN: opt -passes=wholeprogramdevirt -whole-program-visibility -wholeprogramdevirt-summary-action=export -wholeprogramdevirt-read-summary=%S/Inputs/export.yaml -wholeprogramdevirt-write-summary=%t -S -o - %s | FileCheck %s
; RUN: FileCheck --check-prefix=SUMMARY %s < %t

; SUMMARY-NOT:  TypeTests:

; SUMMARY:      TypeIdMap:
; SUMMARY-NEXT:   typeid3:
; SUMMARY-NEXT:     TTRes:
; SUMMARY-NEXT:       Kind:            Unknown
; SUMMARY-NEXT:       SizeM1BitWidth:  0
; SUMMARY-NEXT:       AlignLog2:       0
; SUMMARY-NEXT:       SizeM1:          0
; SUMMARY-NEXT:       BitMask:         0
; SUMMARY-NEXT:       InlineBits:      0
; SUMMARY-NEXT:     WPDRes:
; SUMMARY-NEXT:       0:
; SUMMARY-NEXT:         Kind:            Indir
; SUMMARY-NEXT:         SingleImplName:  ''
; SUMMARY-NEXT:         ResByArg:
; SUMMARY-NEXT:           12,24:
; SUMMARY-NEXT:             Kind:            UniqueRetVal
; SUMMARY-NEXT:             Info:            0
; SUMMARY-NEXT:             Byte:            0
; SUMMARY-NEXT:             Bit:             0
; SUMMARY-NEXT:   typeid4:
; SUMMARY-NEXT:     TTRes:
; SUMMARY-NEXT:       Kind:            Unknown
; SUMMARY-NEXT:       SizeM1BitWidth:  0
; SUMMARY-NEXT:       AlignLog2:       0
; SUMMARY-NEXT:       SizeM1:          0
; SUMMARY-NEXT:       BitMask:         0
; SUMMARY-NEXT:       InlineBits:      0
; SUMMARY-NEXT:     WPDRes:
; SUMMARY-NEXT:       0:
; SUMMARY-NEXT:         Kind:            Indir
; SUMMARY-NEXT:         SingleImplName:  ''
; SUMMARY-NEXT:         ResByArg:
; SUMMARY-NEXT:           24,12:
; SUMMARY-NEXT:             Kind:            UniqueRetVal
; SUMMARY-NEXT:             Info:            1
; SUMMARY-NEXT:             Byte:            0
; SUMMARY-NEXT:             Bit:             0

; CHECK: @vt3a = constant ptr @vf3a
@vt3a = constant ptr @vf3a, !type !0

; CHECK: @vt3b = constant ptr @vf3b
@vt3b = constant ptr @vf3b, !type !0

; CHECK: @vt3c = constant ptr @vf3c
@vt3c = constant ptr @vf3c, !type !0

; CHECK: @vt4a = constant ptr @vf4a
@vt4a = constant ptr @vf4a, !type !1

; CHECK: @vt4b = constant ptr @vf4b
@vt4b = constant ptr @vf4b, !type !1

; CHECK: @vt4c = constant ptr @vf4c
@vt4c = constant ptr @vf4c, !type !1

; CHECK: @__typeid_typeid3_0_12_24_unique_member = hidden alias i8, ptr @vt3b
; CHECK: @__typeid_typeid4_0_24_12_unique_member = hidden alias i8, ptr @vt4b

define i1 @vf3a(ptr, i32, i32) {
  ret i1 true
}

define i1 @vf3b(ptr, i32, i32) {
  ret i1 false
}

define i1 @vf3c(ptr, i32, i32) {
  ret i1 true
}

define i1 @vf4a(ptr, i32, i32) {
  ret i1 false
}

define i1 @vf4b(ptr, i32, i32) {
  ret i1 true
}

define i1 @vf4c(ptr, i32, i32) {
  ret i1 false
}

!0 = !{i32 0, !"typeid3"}
!1 = !{i32 0, !"typeid4"}