xref: /llvm-project/llvm/test/Transforms/WholeProgramDevirt/export-uniform-ret-val.ll (revision 0ecf7965929c4477c8b9821c68e0ad66b012d8fe)
1; 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
2; RUN: FileCheck --check-prefix=SUMMARY %s < %t
3
4; SUMMARY-NOT: TypeTests:
5
6; SUMMARY:      TypeIdMap:
7; SUMMARY-NEXT:   typeid4:
8; SUMMARY-NEXT:     TTRes:
9; SUMMARY-NEXT:       Kind:            Unknown
10; SUMMARY-NEXT:       SizeM1BitWidth:  0
11; SUMMARY-NEXT:       AlignLog2:       0
12; SUMMARY-NEXT:       SizeM1:          0
13; SUMMARY-NEXT:       BitMask:         0
14; SUMMARY-NEXT:       InlineBits:      0
15; SUMMARY-NEXT:     WPDRes:
16; SUMMARY-NEXT:       0:
17; SUMMARY-NEXT:         Kind:            Indir
18; SUMMARY-NEXT:         SingleImplName:  ''
19; SUMMARY-NEXT:         ResByArg:
20; SUMMARY-NEXT:           24,12:
21; SUMMARY-NEXT:             Kind:            UniformRetVal
22; SUMMARY-NEXT:             Info:            36
23; SUMMARY-NEXT:             Byte:            0
24; SUMMARY-NEXT:             Bit:             0
25
26; CHECK: @vt4a = constant ptr @vf4a
27@vt4a = constant ptr @vf4a, !type !0
28
29; CHECK: @vt4b = constant ptr @vf4b
30@vt4b = constant ptr @vf4b, !type !0
31
32define i32 @vf4a(ptr, i32 %x, i32 %y) {
33  %z = add i32 %x, %y
34  ret i32 %z
35}
36
37define i32 @vf4b(ptr, i32 %x, i32 %y) {
38  ret i32 36
39}
40
41!0 = !{i32 0, !"typeid4"}
42