| Jozef Kolek | e7cad7a | 2015-01-13 15:59:17 +0000 | [diff] [blame] | 1 | ; RUN: llc -march=mipsel -mcpu=mips32r2 -mattr=+micromips \ | 
|  | 2 | ; RUN:   -relocation-model=static -O2 < %s | FileCheck %s | 
|  | 3 |  | 
|  | 4 | @main.L = internal unnamed_addr constant [3 x i8*] [i8* blockaddress(@main, %L1), i8* blockaddress(@main, %L2), i8* null], align 4 | 
|  | 5 | @str = private unnamed_addr constant [2 x i8] c"A\00" | 
|  | 6 | @str2 = private unnamed_addr constant [2 x i8] c"B\00" | 
|  | 7 |  | 
|  | 8 | define i32 @main() #0 { | 
|  | 9 | entry: | 
|  | 10 | br label %L1 | 
|  | 11 |  | 
|  | 12 | L1:                                               ; preds = %entry, %L1 | 
|  | 13 | %i.0 = phi i32 [ 0, %entry ], [ %inc, %L1 ] | 
|  | 14 | %puts = tail call i32 @puts(i8* getelementptr inbounds ([2 x i8]* @str, i32 0, i32 0)) | 
|  | 15 | %inc = add i32 %i.0, 1 | 
| David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame^] | 16 | %arrayidx = getelementptr inbounds [3 x i8*], [3 x i8*]* @main.L, i32 0, i32 %i.0 | 
| Jozef Kolek | e7cad7a | 2015-01-13 15:59:17 +0000 | [diff] [blame] | 17 | %0 = load i8** %arrayidx, align 4, !tbaa !1 | 
|  | 18 | indirectbr i8* %0, [label %L1, label %L2] | 
|  | 19 |  | 
|  | 20 | L2:                                               ; preds = %L1 | 
|  | 21 | %puts2 = tail call i32 @puts(i8* getelementptr inbounds ([2 x i8]* @str2, i32 0, i32 0)) | 
|  | 22 | ret i32 0 | 
|  | 23 | } | 
|  | 24 |  | 
|  | 25 | declare i32 @puts(i8* nocapture readonly) #1 | 
|  | 26 |  | 
|  | 27 | !1 = !{!2, !2, i64 0} | 
|  | 28 | !2 = !{!"any pointer", !3, i64 0} | 
|  | 29 | !3 = !{!"omnipotent char", !4, i64 0} | 
|  | 30 | !4 = !{!"Simple C/C++ TBAA"} | 
|  | 31 |  | 
| Jozef Kolek | 650a61a | 2015-02-13 17:51:27 +0000 | [diff] [blame] | 32 | ; CHECK:      jrc | 
| Jozef Kolek | e7cad7a | 2015-01-13 15:59:17 +0000 | [diff] [blame] | 33 |  | 
|  | 34 | %struct.foostruct = type { [3 x float] } | 
|  | 35 | %struct.barstruct = type { %struct.foostruct, float } | 
|  | 36 | @bar_ary = common global [4 x %struct.barstruct] zeroinitializer, align 4 | 
|  | 37 | define float* @spooky(i32 signext %i) #0 { | 
|  | 38 |  | 
| David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame^] | 39 | %safe = getelementptr inbounds [4 x %struct.barstruct], [4 x %struct.barstruct]* @bar_ary, i32 0, i32 %i, i32 1 | 
| Jozef Kolek | e7cad7a | 2015-01-13 15:59:17 +0000 | [diff] [blame] | 40 | store float 1.420000e+02, float* %safe, align 4, !tbaa !1 | 
|  | 41 | ret float* %safe | 
|  | 42 | } | 
|  | 43 |  | 
|  | 44 | ; CHECK:      spooky: | 
| Jozef Kolek | 650a61a | 2015-02-13 17:51:27 +0000 | [diff] [blame] | 45 | ; CHECK:      jrc $ra | 
| Jozef Kolek | e7cad7a | 2015-01-13 15:59:17 +0000 | [diff] [blame] | 46 |  |