brintos

brintos / llvm-project-archived public Read only

0
0
Text · 9.3 KiB · 067b80b Raw
177 lines · plain
1; REQUIRES: asserts2; RUN: llc -debug-only=isel %s -o /dev/null 2>&1 | FileCheck --match-full-lines %s3 4target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"5target triple = "x86_64-unknown-linux-gnu"6 7@str = private unnamed_addr constant [2 x i8] c"1\00", align 18@str.12 = private unnamed_addr constant [2 x i8] c"2\00", align 19@str.13 = private unnamed_addr constant [2 x i8] c"3\00", align 110@str.14 = private unnamed_addr constant [2 x i8] c"4\00", align 111@str.15 = private unnamed_addr constant [2 x i8] c"5\00", align 112@str.16 = private unnamed_addr constant [2 x i8] c"6\00", align 113@str.17 = private unnamed_addr constant [2 x i8] c"7\00", align 114@str.18 = private unnamed_addr constant [2 x i8] c"8\00", align 115@str.19 = private unnamed_addr constant [2 x i8] c"9\00", align 116@str.20 = private unnamed_addr constant [3 x i8] c"10\00", align 117@str.21 = private unnamed_addr constant [3 x i8] c"11\00", align 118@str.22 = private unnamed_addr constant [3 x i8] c"12\00", align 119 20 21 22; Function Attrs: nofree nounwind uwtable23define dso_local void @foo(i32 noundef %cond) local_unnamed_addr #0 !dbg !42 {24;CHECK: Initial selection DAG: %bb.{{[0-9]+}} 'foo:entry'25;CHECK: SelectionDAG has 5 nodes:26;CHECK:     [[TMP1:t.*]]: ch,glue = EntryToken27;CHECK:   [[TMP2:t.*]]: i64,ch = CopyFromReg [[TMP1]], Register:i64 %{{[0-9]+}}, jump_table.c:4:328;CHECK:   t{{[0-9]+}}: ch = br_jt [[TMP2]]:1, JumpTable:i64<0>, [[TMP2]], jump_table.c:4:329 30entry:31  call void @llvm.dbg.value(metadata i32 %cond, metadata !47, metadata !DIExpression()), !dbg !4832  switch i32 %cond, label %sw.epilog [33    i32 1, label %sw.bb34    i32 2, label %sw.bb135    i32 3, label %sw.bb336    i32 4, label %sw.bb537    i32 5, label %sw.bb738    i32 6, label %sw.bb939    i32 7, label %sw.bb1140    i32 8, label %sw.bb1341    i32 9, label %sw.bb1542    i32 10, label %sw.bb1743    i32 11, label %sw.bb1944    i32 12, label %sw.bb2145  ], !dbg !4946 47sw.bb:                                            ; preds = %entry48  %puts = tail call i32 @puts(ptr nonnull dereferenceable(1) @str), !dbg !5049  br label %sw.bb1, !dbg !5050 51sw.bb1:                                           ; preds = %entry, %sw.bb52  %puts23 = tail call i32 @puts(ptr nonnull dereferenceable(1) @str.12), !dbg !5253  br label %sw.bb3, !dbg !5254 55sw.bb3:                                           ; preds = %entry, %sw.bb156  %puts24 = tail call i32 @puts(ptr nonnull dereferenceable(1) @str.13), !dbg !5357  br label %sw.bb5, !dbg !5358 59sw.bb5:                                           ; preds = %entry, %sw.bb360  %puts25 = tail call i32 @puts(ptr nonnull dereferenceable(1) @str.14), !dbg !5461  br label %sw.bb7, !dbg !5462 63sw.bb7:                                           ; preds = %entry, %sw.bb564  %puts26 = tail call i32 @puts(ptr nonnull dereferenceable(1) @str.15), !dbg !5565  br label %sw.bb9, !dbg !5566 67sw.bb9:                                           ; preds = %entry, %sw.bb768  %puts27 = tail call i32 @puts(ptr nonnull dereferenceable(1) @str.16), !dbg !5669  br label %sw.bb11, !dbg !5670 71sw.bb11:                                          ; preds = %entry, %sw.bb972  %puts28 = tail call i32 @puts(ptr nonnull dereferenceable(1) @str.17), !dbg !5773  br label %sw.bb13, !dbg !5774 75sw.bb13:                                          ; preds = %entry, %sw.bb1176  %puts29 = tail call i32 @puts(ptr nonnull dereferenceable(1) @str.18), !dbg !5877  br label %sw.bb15, !dbg !5878 79sw.bb15:                                          ; preds = %entry, %sw.bb1380  %puts30 = tail call i32 @puts(ptr nonnull dereferenceable(1) @str.19), !dbg !5981  br label %sw.bb17, !dbg !5982 83sw.bb17:                                          ; preds = %entry, %sw.bb1584  %puts31 = tail call i32 @puts(ptr nonnull dereferenceable(1) @str.20), !dbg !6085  br label %sw.bb19, !dbg !6086 87sw.bb19:                                          ; preds = %entry, %sw.bb1788  %puts32 = tail call i32 @puts(ptr nonnull dereferenceable(1) @str.21), !dbg !6189  br label %sw.bb21, !dbg !6190 91sw.bb21:                                          ; preds = %entry, %sw.bb1992  %puts33 = tail call i32 @puts(ptr nonnull dereferenceable(1) @str.22), !dbg !6293  ret void, !dbg !6394 95sw.epilog:                                        ; preds = %entry96  ret void, !dbg !6397}98 99; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)100declare void @llvm.dbg.value(metadata, metadata, metadata) #1101 102; Function Attrs: nofree nounwind103declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2104 105attributes #0 = { nofree nounwind uwtable }106attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }107attributes #2 = { nofree nounwind }108 109!llvm.dbg.cu = !{!0}110!llvm.module.flags = !{!34, !35, !36, !37, !38, !39, !40}111!llvm.ident = !{!41}112 113!0 = distinct !DICompileUnit(language: DW_LANG_C11, file: !1, producer: "clang version 18.0.0 (https://github.com/llvm/llvm-project.git 24cf476bd6d144b9fa28325b4d16e3c9dbfc4d4f)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, globals: !2, splitDebugInlining: false, nameTableKind: None)114!1 = !DIFile(filename: "jump_table.c", directory: "/export/compilers/llvm-project", checksumkind: CSK_MD5, checksum: "0847b70de02e07499cd0177d1bdc6dae")115!2 = !{!3, !9, !11, !13, !15, !17, !19, !21, !23, !25, !30, !32}116!3 = !DIGlobalVariableExpression(var: !4, expr: !DIExpression())117!4 = distinct !DIGlobalVariable(scope: null, file: !1, line: 6, type: !5, isLocal: true, isDefinition: true)118!5 = !DICompositeType(tag: DW_TAG_array_type, baseType: !6, size: 24, elements: !7)119!6 = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_signed_char)120!7 = !{!8}121!8 = !DISubrange(count: 3)122!9 = !DIGlobalVariableExpression(var: !10, expr: !DIExpression())123!10 = distinct !DIGlobalVariable(scope: null, file: !1, line: 8, type: !5, isLocal: true, isDefinition: true)124!11 = !DIGlobalVariableExpression(var: !12, expr: !DIExpression())125!12 = distinct !DIGlobalVariable(scope: null, file: !1, line: 10, type: !5, isLocal: true, isDefinition: true)126!13 = !DIGlobalVariableExpression(var: !14, expr: !DIExpression())127!14 = distinct !DIGlobalVariable(scope: null, file: !1, line: 12, type: !5, isLocal: true, isDefinition: true)128!15 = !DIGlobalVariableExpression(var: !16, expr: !DIExpression())129!16 = distinct !DIGlobalVariable(scope: null, file: !1, line: 14, type: !5, isLocal: true, isDefinition: true)130!17 = !DIGlobalVariableExpression(var: !18, expr: !DIExpression())131!18 = distinct !DIGlobalVariable(scope: null, file: !1, line: 16, type: !5, isLocal: true, isDefinition: true)132!19 = !DIGlobalVariableExpression(var: !20, expr: !DIExpression())133!20 = distinct !DIGlobalVariable(scope: null, file: !1, line: 18, type: !5, isLocal: true, isDefinition: true)134!21 = !DIGlobalVariableExpression(var: !22, expr: !DIExpression())135!22 = distinct !DIGlobalVariable(scope: null, file: !1, line: 20, type: !5, isLocal: true, isDefinition: true)136!23 = !DIGlobalVariableExpression(var: !24, expr: !DIExpression())137!24 = distinct !DIGlobalVariable(scope: null, file: !1, line: 22, type: !5, isLocal: true, isDefinition: true)138!25 = !DIGlobalVariableExpression(var: !26, expr: !DIExpression())139!26 = distinct !DIGlobalVariable(scope: null, file: !1, line: 24, type: !27, isLocal: true, isDefinition: true)140!27 = !DICompositeType(tag: DW_TAG_array_type, baseType: !6, size: 32, elements: !28)141!28 = !{!29}142!29 = !DISubrange(count: 4)143!30 = !DIGlobalVariableExpression(var: !31, expr: !DIExpression())144!31 = distinct !DIGlobalVariable(scope: null, file: !1, line: 26, type: !27, isLocal: true, isDefinition: true)145!32 = !DIGlobalVariableExpression(var: !33, expr: !DIExpression())146!33 = distinct !DIGlobalVariable(scope: null, file: !1, line: 28, type: !27, isLocal: true, isDefinition: true)147!34 = !{i32 7, !"Dwarf Version", i32 5}148!35 = !{i32 2, !"Debug Info Version", i32 3}149!36 = !{i32 1, !"wchar_size", i32 4}150!37 = !{i32 8, !"PIC Level", i32 2}151!38 = !{i32 7, !"PIE Level", i32 2}152!39 = !{i32 7, !"uwtable", i32 2}153!40 = !{i32 7, !"debug-info-assignment-tracking", i1 true}154!41 = !{!"clang version 18.0.0 (https://github.com/llvm/llvm-project.git 24cf476bd6d144b9fa28325b4d16e3c9dbfc4d4f)"}155!42 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 3, type: !43, scopeLine: 3, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !46)156!43 = !DISubroutineType(types: !44)157!44 = !{null, !45}158!45 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)159!46 = !{!47}160!47 = !DILocalVariable(name: "cond", arg: 1, scope: !42, file: !1, line: 3, type: !45)161!48 = !DILocation(line: 0, scope: !42)162!49 = !DILocation(line: 4, column: 3, scope: !42)163!50 = !DILocation(line: 6, column: 5, scope: !51)164!51 = distinct !DILexicalBlock(scope: !42, file: !1, line: 4, column: 17)165!52 = !DILocation(line: 8, column: 5, scope: !51)166!53 = !DILocation(line: 10, column: 5, scope: !51)167!54 = !DILocation(line: 12, column: 5, scope: !51)168!55 = !DILocation(line: 14, column: 5, scope: !51)169!56 = !DILocation(line: 16, column: 5, scope: !51)170!57 = !DILocation(line: 18, column: 5, scope: !51)171!58 = !DILocation(line: 20, column: 5, scope: !51)172!59 = !DILocation(line: 22, column: 5, scope: !51)173!60 = !DILocation(line: 24, column: 5, scope: !51)174!61 = !DILocation(line: 26, column: 5, scope: !51)175!62 = !DILocation(line: 28, column: 5, scope: !51)176!63 = !DILocation(line: 30, column: 1, scope: !42)177