[ARM] Add Virtualization subtarget feature and more build attributes in this area
[oota-llvm.git] / test / CodeGen / ARM / noreturn.ll
1 ; RUN: llc -O3 -o - %s | FileCheck %s
2 ; Test case from PR16882.
3 target triple = "thumbv7s-apple-ios"
4
5 ; Function Attrs: noreturn
6 define i32 @test1() #0 {
7 ; CHECK-LABEL: @test1
8 ; CHECK-NOT: push
9 entry:
10   tail call void @overflow() #0
11   unreachable
12 }
13
14 ; Function Attrs: noreturn
15 declare void @overflow() #0
16
17 define i32 @test2(i32 %x, i32 %y) {
18 ; CHECK-LABEL: @test2
19 ; CHECK-NOT: push
20 ; CHECK-NOT: pop
21 entry:
22   %conv = sext i32 %x to i64
23   %conv1 = sext i32 %y to i64
24   %mul = mul nsw i64 %conv1, %conv
25   %conv2 = trunc i64 %mul to i32
26   %conv3 = sext i32 %conv2 to i64
27   %cmp = icmp eq i64 %mul, %conv3
28   br i1 %cmp, label %if.end, label %if.then
29
30 if.then:                                          ; preds = %entry
31   tail call void @overflow() #0
32   unreachable
33
34 if.end:                                           ; preds = %entry
35   ret i32 %conv2
36 }
37
38 attributes #0 = { noreturn }