• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc -verify-machineinstrs < %s -mtriple=aarch64-none-linux-gnu -O0
2
3; When WZR wasn't marked as reserved, this function tried to allocate
4; it at O0 and then generated an internal fault (mostly incidentally)
5; when it discovered that it was already in use for a multiplication.
6
7; I'm not really convinced this is a good test since it could easily
8; stop testing what it does now with no-one any the wiser. However, I
9; can't think of a better way to force the allocator to use WZR
10; specifically.
11
12define void @test() nounwind {
13entry:
14  br label %for.cond
15
16for.cond:                                         ; preds = %for.body, %entry
17  br i1 undef, label %for.body, label %for.end
18
19for.body:                                         ; preds = %for.cond
20  br label %for.cond
21
22for.end:                                          ; preds = %for.cond
23  br label %for.cond6
24
25for.cond6:                                        ; preds = %for.body9, %for.end
26  br i1 undef, label %for.body9, label %while.cond30
27
28for.body9:                                        ; preds = %for.cond6
29  store i16 0, i16* undef, align 2
30  %0 = load i32* undef, align 4
31  %1 = load i32* undef, align 4
32  %mul15 = mul i32 %0, %1
33  %add16 = add i32 %mul15, 32768
34  %div = udiv i32 %add16, 65535
35  %add17 = add i32 %div, 1
36  store i32 %add17, i32* undef, align 4
37  br label %for.cond6
38
39while.cond30:                                     ; preds = %for.cond6
40  ret void
41}
42