[opaque pointer type] Add textual IR support for explicit type parameter to gep operator
[oota-llvm.git] / test / CodeGen / Mips / brind.ll
1 ; RUN: llc  -march=mipsel -mcpu=mips16 -relocation-model=pic -O3 < %s | FileCheck %s -check-prefix=16
2
3 @main.L = internal unnamed_addr constant [5 x i8*] [i8* blockaddress(@main, %L1), i8* blockaddress(@main, %L2), i8* blockaddress(@main, %L3), i8* blockaddress(@main, %L4), i8* null], align 4
4 @str = private unnamed_addr constant [2 x i8] c"A\00"
5 @str5 = private unnamed_addr constant [2 x i8] c"B\00"
6 @str6 = private unnamed_addr constant [2 x i8] c"C\00"
7 @str7 = private unnamed_addr constant [2 x i8] c"D\00"
8 @str8 = private unnamed_addr constant [2 x i8] c"E\00"
9
10 define i32 @main() nounwind {
11 entry:
12   %puts = tail call i32 @puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @str, i32 0, i32 0))
13   br label %L1
14
15 L1:                                               ; preds = %entry, %L3
16   %i.0 = phi i32 [ 0, %entry ], [ %inc, %L3 ]
17   %puts5 = tail call i32 @puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @str5, i32 0, i32 0))
18   br label %L2
19
20 L2:                                               ; preds = %L1, %L3
21   %i.1 = phi i32 [ %i.0, %L1 ], [ %inc, %L3 ]
22   %puts6 = tail call i32 @puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @str6, i32 0, i32 0))
23   br label %L3
24
25 L3:                                               ; preds = %L2, %L3
26   %i.2 = phi i32 [ %i.1, %L2 ], [ %inc, %L3 ]
27   %puts7 = tail call i32 @puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @str7, i32 0, i32 0))
28   %inc = add i32 %i.2, 1
29   %arrayidx = getelementptr inbounds [5 x i8*], [5 x i8*]* @main.L, i32 0, i32 %i.2
30   %0 = load i8*, i8** %arrayidx, align 4
31   indirectbr i8* %0, [label %L1, label %L2, label %L3, label %L4]
32 ; 16:   jrc      ${{[0-9]+}}
33 L4:                                               ; preds = %L3
34   %puts8 = tail call i32 @puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @str8, i32 0, i32 0))
35   ret i32 0
36 }
37
38 declare i32 @puts(i8* nocapture) nounwind
39
40