[WebAssembly] Don't perform the returned-argument optimization on constants.
[oota-llvm.git] / test / CodeGen / ARM / pr13249.ll
1 ; RUN: llc < %s -mtriple armv7--linux-gnueabi
2
3 define arm_aapcscc i8* @__strtok_r_1c(i8* %arg, i8 signext %arg1, i8** nocapture %arg2) nounwind {
4 bb:
5   br label %bb3
6
7 bb3:                                              ; preds = %bb3, %bb
8   %tmp = phi i8* [ %tmp5, %bb3 ], [ %arg, %bb ]
9   %tmp4 = load i8, i8* %tmp, align 1
10   %tmp5 = getelementptr inbounds i8, i8* %tmp, i32 1
11   br i1 undef, label %bb3, label %bb7
12
13 bb7:                                              ; preds = %bb13, %bb3
14   %tmp8 = phi i8 [ %tmp14, %bb13 ], [ %tmp4, %bb3 ]
15   %tmp9 = phi i8* [ %tmp12, %bb13 ], [ %tmp, %bb3 ]
16   %tmp10 = icmp ne i8 %tmp8, %arg1
17   %tmp12 = getelementptr inbounds i8, i8* %tmp9, i32 1
18   br i1 %tmp10, label %bb13, label %bb15
19
20 bb13:                                             ; preds = %bb7
21   %tmp14 = load i8, i8* %tmp12, align 1
22   br label %bb7
23
24 bb15:                                             ; preds = %bb7
25   store i8* %tmp9, i8** %arg2, align 4
26   ret i8* %tmp
27 }