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 4target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" 5target triple = "x86_64-apple-darwin13.2.0" 6 7%struct = type { i8*, i8* } 8 9; CHECK-LABEL: @foo() { 10define internal i8* @foo() { 11entry: 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 18if.end: 19; CHECK: %retained2 = call i8* @objc_retain(i8* %retained1) 20 %retained2 = call i8* @objc_retain(i8* %retained1) 21 br label %cleanup 22 23cleanup: 24 %retval = phi i8* [ %retained2, %if.end ], [ null, %entry ] 25 ret i8* %retval 26} 27 28declare i8* @bar() 29 30declare extern_weak i8* @objc_retain(i8*) 31