~pali/+junk/llvm-toolchain-3.7

« back to all changes in this revision

Viewing changes to test/Transforms/ObjCARC/contract-end-of-use-list.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 -objc-arc-expand -objc-arc-contract | FileCheck %s
 
2
; Don't crash.  Reproducer for a use_iterator bug from r203364.
 
3
; rdar://problem/16333235
 
4
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
 
5
target triple = "x86_64-apple-darwin13.2.0"
 
6
 
 
7
%struct = type { i8*, i8* }
 
8
 
 
9
; CHECK-LABEL: @foo() {
 
10
define internal i8* @foo() {
 
11
entry:
 
12
  %call = call i8* @bar()
 
13
; CHECK: %retained1 = call i8* @objc_retainAutoreleasedReturnValue(i8* %call)
 
14
  %retained1 = call i8* @objc_retain(i8* %call)
 
15
  %isnull = icmp eq i8* %retained1, null
 
16
  br i1 %isnull, label %cleanup, label %if.end
 
17
 
 
18
if.end:
 
19
; CHECK: %retained2 = call i8* @objc_retain(i8* %retained1)
 
20
  %retained2 = call i8* @objc_retain(i8* %retained1)
 
21
  br label %cleanup
 
22
 
 
23
cleanup:
 
24
  %retval = phi i8* [ %retained2, %if.end ], [ null, %entry ]
 
25
  ret i8* %retval
 
26
}
 
27
 
 
28
declare i8* @bar()
 
29
 
 
30
declare extern_weak i8* @objc_retain(i8*)