~pali/+junk/llvm-toolchain-3.7

« back to all changes in this revision

Viewing changes to test/Transforms/Inline/nonnull.ll

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2015-07-15 17:51:08 UTC
  • Revision ID: package-import@ubuntu.com-20150715175108-l8mynwovkx4zx697
Tags: upstream-3.7~+rc2
ImportĀ upstreamĀ versionĀ 3.7~+rc2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
; RUN: opt -S -inline %s | FileCheck %s
 
2
 
 
3
declare void @foo()
 
4
declare void @bar()
 
5
 
 
6
define void @callee(i8* %arg) {
 
7
  %cmp = icmp eq i8* %arg, null
 
8
  br i1 %cmp, label %expensive, label %done
 
9
 
 
10
; This block is designed to be too expensive to inline.  We can only inline
 
11
; callee if this block is known to be dead.
 
12
expensive:
 
13
  call void @foo()
 
14
  call void @foo()
 
15
  call void @foo()
 
16
  call void @foo()
 
17
  call void @foo()
 
18
  call void @foo()
 
19
  call void @foo()
 
20
  call void @foo()
 
21
  call void @foo()
 
22
  call void @foo()
 
23
  ret void
 
24
 
 
25
done:
 
26
  call void @bar()
 
27
  ret void
 
28
}
 
29
 
 
30
; Positive test - arg is known non null
 
31
define void @caller(i8* nonnull %arg) {
 
32
; CHECK-LABEL: @caller
 
33
; CHECK: call void @bar()
 
34
  call void @callee(i8* nonnull %arg)
 
35
  ret void
 
36
}
 
37
 
 
38
; Negative test - arg is not known to be non null
 
39
define void @caller2(i8* %arg) {
 
40
; CHECK-LABEL: @caller2
 
41
; CHECK: call void @callee(
 
42
  call void @callee(i8* %arg)
 
43
  ret void
 
44
}
 
45