• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; Test that the set of used phys regs used by interprocedural register
2; allocation is correct for a test case where the called function (@fn2)
3; itself has a call (to @fn1). @fn1 defines %r0l, while @fn2 defines
4; %r0d. The RegUsageInfo for @fn2 must include %r0h.
5;
6; RUN: llc -mtriple=s390x-linux-gnu -mcpu=z13 -enable-ipra -print-regusage 2>&1 < %s \
7; RUN:   | FileCheck %s
8;
9; CHECK: fn2 Clobbered Registers: {{.*}} $r0h
10
11@h = external global [0 x i32], align 4
12@n = external global i32*, align 8
13
14define void @fn1() {
15bb:
16  br label %bb1
17
18bb1:                                              ; preds = %bb1, %bb
19  %tmp = getelementptr inbounds [0 x i32], [0 x i32]* @h, i64 0, i64 undef
20  %tmp2 = load i32, i32* %tmp
21  store i32 %tmp2, i32* undef
22  br label %bb1
23}
24
25define void @fn2() {
26bb:
27  br label %bb1
28
29bb1:                                              ; preds = %bb
30  br i1 undef, label %bb2, label %bb3
31
32bb2:                                              ; preds = %bb1
33  store i32* null, i32** @n
34  unreachable
35
36bb3:                                              ; preds = %bb1
37  call void @fn1()
38  unreachable
39}
40
41define void @main() {
42bb:
43  call void @fn2()
44  ret void
45}
46