1; RUN: llc < %s -mtriple=arm64-apple-ios
2; rdar://11849816
3
4@shlib_path_substitutions = external hidden unnamed_addr global i8**, align 8
5
6declare i64 @llvm.objectsize.i64(i8*, i1) nounwind readnone
7
8declare noalias i8* @xmalloc(i64) optsize
9
10declare i64 @strlen(i8* nocapture) nounwind readonly optsize
11
12declare i8* @__strcpy_chk(i8*, i8*, i64) nounwind optsize
13
14declare i8* @__strcat_chk(i8*, i8*, i64) nounwind optsize
15
16declare noalias i8* @xstrdup(i8*) optsize
17
18define i8* @dyld_fix_path(i8* %path) nounwind optsize ssp {
19entry:
20  br i1 undef, label %if.end56, label %for.cond
21
22for.cond:                                         ; preds = %entry
23  br i1 undef, label %for.cond10, label %for.body
24
25for.body:                                         ; preds = %for.cond
26  unreachable
27
28for.cond10:                                       ; preds = %for.cond
29  br i1 undef, label %if.end56, label %for.body14
30
31for.body14:                                       ; preds = %for.cond10
32  %call22 = tail call i64 @strlen(i8* undef) nounwind optsize
33  %sext = shl i64 %call22, 32
34  %conv30 = ashr exact i64 %sext, 32
35  %add29 = sub i64 0, %conv30
36  %sub = add i64 %add29, 0
37  %add31 = shl i64 %sub, 32
38  %sext59 = add i64 %add31, 4294967296
39  %conv33 = ashr exact i64 %sext59, 32
40  %call34 = tail call noalias i8* @xmalloc(i64 %conv33) nounwind optsize
41  br i1 undef, label %cond.false45, label %cond.true43
42
43cond.true43:                                      ; preds = %for.body14
44  unreachable
45
46cond.false45:                                     ; preds = %for.body14
47  %add.ptr = getelementptr inbounds i8, i8* %path, i64 %conv30
48  unreachable
49
50if.end56:                                         ; preds = %for.cond10, %entry
51  ret i8* null
52}
53
54declare i32 @strncmp(i8* nocapture, i8* nocapture, i64) nounwind readonly optsize
55
56declare i8* @strcpy(i8*, i8* nocapture) nounwind
57