~pali/+junk/llvm-toolchain-3.7

« back to all changes in this revision

Viewing changes to test/CodeGen/MIR/successor-basic-blocks.mir

  • 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: llc -start-after branch-folder -stop-after branch-folder -o /dev/null %s | FileCheck %s
 
2
# This test ensures that the MIR parser parses basic block successors correctly.
 
3
 
 
4
--- |
 
5
 
 
6
  define i32 @foo(i32 %a) {
 
7
  entry:
 
8
    %0 = icmp sle i32 %a, 10
 
9
    br i1 %0, label %less, label %exit
 
10
 
 
11
  less:
 
12
    ret i32 0
 
13
 
 
14
  exit:
 
15
    ret i32 %a
 
16
  }
 
17
 
 
18
  define i32 @bar(i32 %a) {
 
19
  entry:
 
20
    %b = icmp sle i32 %a, 10
 
21
    br i1 %b, label %0, label %1
 
22
 
 
23
  ; <label>:0
 
24
    ret i32 0
 
25
 
 
26
  ; <label>:1
 
27
    ret i32 %a
 
28
  }
 
29
 
 
30
...
 
31
---
 
32
name:            foo
 
33
body:
 
34
  # CHECK: name: entry
 
35
  # CHECK: successors: [ '%bb.1.less', '%bb.2.exit' ]
 
36
  # CHECK: name: less
 
37
  - id:          0
 
38
    name:        entry
 
39
    successors:  [ '%bb.1.less', '%bb.2.exit' ]
 
40
  - id:          1
 
41
    name:        less
 
42
  - id:          2
 
43
    name:        exit
 
44
...
 
45
---
 
46
name:            bar
 
47
body:
 
48
  # CHECK: name: bar
 
49
  # CHECK: name: entry
 
50
  # CHECK: successors: [ '%bb.1', '%bb.2' ]
 
51
  # CHECK: id: 1
 
52
  # CHECK: id: 2
 
53
  - id:          0
 
54
    name:        entry
 
55
    successors:  [ '%bb.1', '%bb.2' ]
 
56
  - id:          1
 
57
  - id:          2
 
58
...