brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.7 KiB · 59ca8ce Raw
105 lines · plain
1; RUN: llc -mtriple=bpfel -mcpu=v4 -verify-machineinstrs -show-mc-encoding < %s | FileCheck %s2; Source:3;  int f1(char *p) {4;    return *p;5;  }6;  int f2(short *p) {7;    return *p;8;  }9;  int f3(int *p) {10;    return *p;11;  }12;  long f4(char *p) {13;    return *p;14;  }15;  long f5(short *p) {16;    return *p;17;  }18;  long f6(int *p) {19;    return *p;20;  }21;  long f7(long *p) {22;    return *p;23;  }24; Compilation flags:25;   clang -target bpf -O2 -S -emit-llvm t.c26 27; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read)28define dso_local i32 @f1(ptr nocapture noundef readonly %p) local_unnamed_addr #0 {29entry:30  %0 = load i8, ptr %p, align 1, !tbaa !331  %conv = sext i8 %0 to i3232  ret i32 %conv33}34; CHECK:  r0 = *(s8 *)(r1 + 0)                    # encoding: [0x91,0x10,0x00,0x00,0x00,0x00,0x00,0x00]35 36; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read)37define dso_local i32 @f2(ptr nocapture noundef readonly %p) local_unnamed_addr #0 {38entry:39  %0 = load i16, ptr %p, align 2, !tbaa !640  %conv = sext i16 %0 to i3241  ret i32 %conv42}43; CHECK:  r0 = *(s16 *)(r1 + 0)                   # encoding: [0x89,0x10,0x00,0x00,0x00,0x00,0x00,0x00]44 45; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read)46define dso_local i32 @f3(ptr nocapture noundef readonly %p) local_unnamed_addr #0 {47entry:48  %0 = load i32, ptr %p, align 4, !tbaa !849  ret i32 %050}51; CHECK:  w0 = *(u32 *)(r1 + 0)                   # encoding: [0x61,0x10,0x00,0x00,0x00,0x00,0x00,0x00]52 53; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read)54define dso_local i64 @f4(ptr nocapture noundef readonly %p) local_unnamed_addr #0 {55entry:56  %0 = load i8, ptr %p, align 1, !tbaa !357  %conv = sext i8 %0 to i6458  ret i64 %conv59}60; CHECK:  r0 = *(s8 *)(r1 + 0)                    # encoding: [0x91,0x10,0x00,0x00,0x00,0x00,0x00,0x00]61 62; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read)63define dso_local i64 @f5(ptr nocapture noundef readonly %p) local_unnamed_addr #0 {64entry:65  %0 = load i16, ptr %p, align 2, !tbaa !666  %conv = sext i16 %0 to i6467  ret i64 %conv68}69; CHECK:  r0 = *(s16 *)(r1 + 0)                   # encoding: [0x89,0x10,0x00,0x00,0x00,0x00,0x00,0x00]70 71; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read)72define dso_local i64 @f6(ptr nocapture noundef readonly %p) local_unnamed_addr #0 {73entry:74  %0 = load i32, ptr %p, align 4, !tbaa !875  %conv = sext i32 %0 to i6476  ret i64 %conv77}78; CHECK:  r0 = *(s32 *)(r1 + 0)                   # encoding: [0x81,0x10,0x00,0x00,0x00,0x00,0x00,0x00]79 80; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read)81define dso_local i64 @f7(ptr nocapture noundef readonly %p) local_unnamed_addr #0 {82entry:83  %0 = load i64, ptr %p, align 8, !tbaa !1084  ret i64 %085}86; CHECK:  r0 = *(u64 *)(r1 + 0)                   # encoding: [0x79,0x10,0x00,0x00,0x00,0x00,0x00,0x00]87 88attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) "frame-pointer"="all" "no-trapping-math"="true" "stack-protector-buffer-size"="8" }89 90!llvm.module.flags = !{!0, !1}91!llvm.ident = !{!2}92 93!0 = !{i32 1, !"wchar_size", i32 4}94!1 = !{i32 7, !"frame-pointer", i32 2}95!2 = !{!"clang version 17.0.0 (https://github.com/llvm/llvm-project.git 1bf3221bf1e35d953a0b6783bc6e694cb9b0ceae)"}96!3 = !{!4, !4, i64 0}97!4 = !{!"omnipotent char", !5, i64 0}98!5 = !{!"Simple C/C++ TBAA"}99!6 = !{!7, !7, i64 0}100!7 = !{!"short", !4, i64 0}101!8 = !{!9, !9, i64 0}102!9 = !{!"int", !4, i64 0}103!10 = !{!11, !11, i64 0}104!11 = !{!"long", !4, i64 0}105