Justin Lebar | 49fac56 | 2018-12-26 19:12:31 +0000 | [diff] [blame] | 1 | ; RUN: llc < %s -march=nvptx 2>&1 | FileCheck %s |
2 | ; Make sure the example doesn't crash with segfault | ||||
3 | |||||
4 | ; CHECK: .visible .func ({{.*}}) loop | ||||
5 | define i32 @loop(i32, i32) { | ||||
6 | entry: | ||||
7 | br label %loop | ||||
8 | |||||
9 | loop: | ||||
10 | %i = phi i32 [ %0, %entry ], [ %res, %loop ] | ||||
11 | %res = call i32 @div(i32 %i, i32 %1) | ||||
12 | |||||
13 | %exitcond = icmp eq i32 %res, %0 | ||||
14 | br i1 %exitcond, label %exit, label %loop | ||||
15 | |||||
16 | exit: | ||||
17 | ret i32 %res | ||||
18 | } | ||||
19 | |||||
20 | define i32 @div(i32, i32) { | ||||
21 | ret i32 0 | ||||
22 | } |