2015-03-25 20:11:48 +08:00
|
|
|
; RUN: %lli -jit-kind=orc-mcjit -relocation-model=pic -code-model=small %s > /dev/null
|
2016-08-20 01:06:39 +08:00
|
|
|
; XFAIL: mips-, mipsel-, aarch64, arm, i686, i386
|
2015-02-02 13:04:55 +08:00
|
|
|
|
|
|
|
@count = global i32 1, align 4
|
|
|
|
|
|
|
|
define i32 @main() nounwind uwtable {
|
|
|
|
entry:
|
|
|
|
%retval = alloca i32, align 4
|
|
|
|
%i = alloca i32, align 4
|
|
|
|
store i32 0, i32* %retval
|
|
|
|
store i32 0, i32* %i, align 4
|
|
|
|
br label %for.cond
|
|
|
|
|
|
|
|
for.cond: ; preds = %for.inc, %entry
|
2015-02-28 05:17:42 +08:00
|
|
|
%0 = load i32, i32* %i, align 4
|
2015-02-02 13:04:55 +08:00
|
|
|
%cmp = icmp slt i32 %0, 49
|
|
|
|
br i1 %cmp, label %for.body, label %for.end
|
|
|
|
|
|
|
|
for.body: ; preds = %for.cond
|
2015-02-28 05:17:42 +08:00
|
|
|
%1 = load i32, i32* @count, align 4
|
2015-02-02 13:04:55 +08:00
|
|
|
%inc = add nsw i32 %1, 1
|
|
|
|
store i32 %inc, i32* @count, align 4
|
|
|
|
br label %for.inc
|
|
|
|
|
|
|
|
for.inc: ; preds = %for.body
|
2015-02-28 05:17:42 +08:00
|
|
|
%2 = load i32, i32* %i, align 4
|
2015-02-02 13:04:55 +08:00
|
|
|
%inc1 = add nsw i32 %2, 1
|
|
|
|
store i32 %inc1, i32* %i, align 4
|
|
|
|
br label %for.cond
|
|
|
|
|
|
|
|
for.end: ; preds = %for.cond
|
2015-02-28 05:17:42 +08:00
|
|
|
%3 = load i32, i32* @count, align 4
|
2015-02-02 13:04:55 +08:00
|
|
|
%sub = sub nsw i32 %3, 50
|
|
|
|
ret i32 %sub
|
|
|
|
}
|