brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.5 KiB · 7d11621 Raw
47 lines · plain
1; RUN: llc -mtriple=mipsel -mcpu=mips32r2 -mattr=+micromips \2; RUN:   -relocation-model=static -O2 < %s | FileCheck %s3 4@main.L = internal unnamed_addr constant [3 x ptr] [ptr blockaddress(@main, %L1), ptr blockaddress(@main, %L2), ptr null], align 45@str = private unnamed_addr constant [2 x i8] c"A\00"6@str2 = private unnamed_addr constant [2 x i8] c"B\00"7 8define i32 @main() #0 {9entry:10  br label %L111 12L1:                                               ; preds = %entry, %L113  %i.0 = phi i32 [ 0, %entry ], [ %inc, %L1 ]14  %puts = tail call i32 @puts(ptr @str)15  %inc = add i32 %i.0, 116  %arrayidx = getelementptr inbounds [3 x ptr], ptr @main.L, i32 0, i32 %i.017  %0 = load ptr, ptr %arrayidx, align 4, !tbaa !118  indirectbr ptr %0, [label %L1, label %L2]19 20L2:                                               ; preds = %L121  %puts2 = tail call i32 @puts(ptr @str2)22  ret i32 023}24 25declare i32 @puts(ptr nocapture readonly) #126 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 32; CHECK:      jrc33 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 437define ptr @spooky(i32 signext %i) #0 {38 39  %safe = getelementptr inbounds [4 x %struct.barstruct], ptr @bar_ary, i32 0, i32 %i, i32 140  store float 1.420000e+02, ptr %safe, align 4, !tbaa !141  ret ptr %safe42}43 44; CHECK:      spooky:45; CHECK:      jrc $ra46 47