[MIParser] Set RegClassOrRegBank during instruction parsing
[llvm-complete.git] / test / CodeGen / BPF / BTF / func-typedef.ll
blob46fc883ec282e483d53e2bf27dac3e98e777fca0
1 ; RUN: llc -march=bpfel -filetype=asm -o - %s | FileCheck -check-prefixes=CHECK %s
2 ; RUN: llc -march=bpfeb -filetype=asm -o - %s | FileCheck -check-prefixes=CHECK %s
4 ; Source code:
5 ;   typedef int _int;
6 ;   typedef _int __int;
7 ;   __int f(__int a) { return a; }
8 ; Compilation flag:
9 ;   clang -target bpf -O2 -g -S -emit-llvm t.c
11 ; Function Attrs: nounwind readnone
12 define dso_local i32 @f(i32 returned %a) local_unnamed_addr #0 !dbg !7 {
13 entry:
14   call void @llvm.dbg.value(metadata i32 %a, metadata !14, metadata !DIExpression()), !dbg !15
15   ret i32 %a, !dbg !16
18 ; CHECK:             .section        .BTF,"",@progbits
19 ; CHECK-NEXT:        .short  60319                   # 0xeb9f
20 ; CHECK-NEXT:        .byte   1
21 ; CHECK-NEXT:        .byte   0
22 ; CHECK-NEXT:        .long   24
23 ; CHECK-NEXT:        .long   0
24 ; CHECK-NEXT:        .long   72
25 ; CHECK-NEXT:        .long   72
26 ; CHECK-NEXT:        .long   35
27 ; CHECK-NEXT:        .long   1                       # BTF_KIND_TYPEDEF(id = 1)
28 ; CHECK-NEXT:        .long   134217728               # 0x8000000
29 ; CHECK-NEXT:        .long   2
30 ; CHECK-NEXT:        .long   7                       # BTF_KIND_TYPEDEF(id = 2)
31 ; CHECK-NEXT:        .long   134217728               # 0x8000000
32 ; CHECK-NEXT:        .long   3
33 ; CHECK-NEXT:        .long   12                      # BTF_KIND_INT(id = 3)
34 ; CHECK-NEXT:        .long   16777216                # 0x1000000
35 ; CHECK-NEXT:        .long   4
36 ; CHECK-NEXT:        .long   16777248                # 0x1000020
37 ; CHECK-NEXT:        .long   0                       # BTF_KIND_FUNC_PROTO(id = 4)
38 ; CHECK-NEXT:        .long   218103809               # 0xd000001
39 ; CHECK-NEXT:        .long   1
40 ; CHECK-NEXT:        .long   16
41 ; CHECK-NEXT:        .long   1
42 ; CHECK-NEXT:        .long   18                      # BTF_KIND_FUNC(id = 5)
43 ; CHECK-NEXT:        .long   201326592               # 0xc000000
44 ; CHECK-NEXT:        .long   4
45 ; CHECK-NEXT:        .byte   0                       # string offset=0
46 ; CHECK-NEXT:        .ascii  "__int"                 # string offset=1
47 ; CHECK-NEXT:        .byte   0
48 ; CHECK-NEXT:        .ascii  "_int"                  # string offset=7
49 ; CHECK-NEXT:        .byte   0
50 ; CHECK-NEXT:        .ascii  "int"                   # string offset=12
51 ; CHECK-NEXT:        .byte   0
52 ; CHECK-NEXT:        .byte   97                      # string offset=16
53 ; CHECK-NEXT:        .byte   0
54 ; CHECK-NEXT:        .byte   102                     # string offset=18
55 ; CHECK-NEXT:        .byte   0
56 ; CHECK-NEXT:        .ascii  ".text"                 # string offset=20
57 ; CHECK-NEXT:        .byte   0
58 ; CHECK-NEXT:        .ascii  "/tmp/t.c"              # string offset=26
59 ; CHECK-NEXT:        .byte   0
60 ; CHECK-NEXT:        .section        .BTF.ext,"",@progbits
61 ; CHECK-NEXT:        .short  60319                   # 0xeb9f
62 ; CHECK-NEXT:        .byte   1
63 ; CHECK-NEXT:        .byte   0
64 ; CHECK-NEXT:        .long   32
65 ; CHECK-NEXT:        .long   0
66 ; CHECK-NEXT:        .long   20
67 ; CHECK-NEXT:        .long   20
68 ; CHECK-NEXT:        .long   44
69 ; CHECK-NEXT:        .long   64
70 ; CHECK-NEXT:        .long   0
71 ; CHECK-NEXT:        .long   8                       # FuncInfo
72 ; CHECK-NEXT:        .long   20                      # FuncInfo section string offset=20
73 ; CHECK-NEXT:        .long   1
74 ; CHECK-NEXT:        .long   .Lfunc_begin0
75 ; CHECK-NEXT:        .long   5
76 ; CHECK-NEXT:        .long   16                      # LineInfo
77 ; CHECK-NEXT:        .long   20                      # LineInfo section string offset=20
78 ; CHECK-NEXT:        .long   2
79 ; CHECK-NEXT:        .long   .Lfunc_begin0
80 ; CHECK-NEXT:        .long   26
81 ; CHECK-NEXT:        .long   0
82 ; CHECK-NEXT:        .long   3072                    # Line 3 Col 0
83 ; CHECK-NEXT:        .long   .Ltmp{{[0-9]+}}
84 ; CHECK-NEXT:        .long   26
85 ; CHECK-NEXT:        .long   0
86 ; CHECK-NEXT:        .long   3092                    # Line 3 Col 20
89 ; Function Attrs: nounwind readnone speculatable
90 declare void @llvm.dbg.value(metadata, metadata, metadata) #1
92 attributes #0 = { nounwind readnone "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
93 attributes #1 = { nounwind readnone speculatable }
95 !llvm.dbg.cu = !{!0}
96 !llvm.module.flags = !{!3, !4, !5}
97 !llvm.ident = !{!6}
99 !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 8.0.0 (trunk 344789) (llvm/trunk 344782)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, nameTableKind: None)
100 !1 = !DIFile(filename: "t.c", directory: "/tmp")
101 !2 = !{}
102 !3 = !{i32 2, !"Dwarf Version", i32 4}
103 !4 = !{i32 2, !"Debug Info Version", i32 3}
104 !5 = !{i32 1, !"wchar_size", i32 4}
105 !6 = !{!"clang version 8.0.0 (trunk 344789) (llvm/trunk 344782)"}
106 !7 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 3, type: !8, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: true, unit: !0, retainedNodes: !13)
107 !8 = !DISubroutineType(types: !9)
108 !9 = !{!10, !10}
109 !10 = !DIDerivedType(tag: DW_TAG_typedef, name: "__int", file: !1, line: 2, baseType: !11)
110 !11 = !DIDerivedType(tag: DW_TAG_typedef, name: "_int", file: !1, line: 1, baseType: !12)
111 !12 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
112 !13 = !{!14}
113 !14 = !DILocalVariable(name: "a", arg: 1, scope: !7, file: !1, line: 3, type: !10)
114 !15 = !DILocation(line: 3, column: 15, scope: !7)
115 !16 = !DILocation(line: 3, column: 20, scope: !7)