~pali/+junk/llvm-toolchain-3.7

« back to all changes in this revision

Viewing changes to test/Transforms/IPConstantProp/user-with-multiple-uses.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 -S -ipsccp | FileCheck %s
 
2
; PR5596
 
3
 
 
4
; IPSCCP should propagate the 0 argument, eliminate the switch, and propagate
 
5
; the result.
 
6
 
 
7
; CHECK: define i32 @main() #0 {
 
8
; CHECK-NEXT: entry:
 
9
; CHECK-NEXT: %call2 = tail call i32 @wwrite(i64 0) [[NUW:#[0-9]+]]
 
10
; CHECK-NEXT: ret i32 123
 
11
 
 
12
define i32 @main() noreturn nounwind {
 
13
entry:
 
14
  %call2 = tail call i32 @wwrite(i64 0) nounwind
 
15
  ret i32 %call2
 
16
}
 
17
 
 
18
define internal i32 @wwrite(i64 %i) nounwind readnone {
 
19
entry:
 
20
  switch i64 %i, label %sw.default [
 
21
    i64 3, label %return
 
22
    i64 10, label %return
 
23
  ]
 
24
 
 
25
sw.default:
 
26
  ret i32 123
 
27
 
 
28
return:
 
29
  ret i32 0
 
30
}
 
31
 
 
32
; CHECK: attributes #0 = { noreturn nounwind }
 
33
; CHECK: attributes #1 = { nounwind readnone }
 
34
; CHECK: attributes [[NUW]] = { nounwind }