OSDN Git Service

[DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label.
[android-x86/external-llvm.git] / test / CodeGen / X86 / fold-zext-trunc.ll
1 ; RUN: llc < %s | FileCheck %s -check-prefix=ASM
2 ; RUN: llc < %s -O0 -mtriple=x86_64-unknown-unknown -mcpu=x86-64 -stop-after livedebugvalues -o - | FileCheck %s -check-prefix=MIR
3 ; PR9055
4 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32"
5 target triple = "i686-pc-linux-gnu"
6
7 %struct.S0 = type { i32, [2 x i8], [2 x i8], [4 x i8] }
8
9 @g_98 = common global %struct.S0 zeroinitializer, align 4
10
11 define void @foo() nounwind !dbg !5 {
12 ; ASM: movzbl
13 ; ASM-NOT: movzbl
14 ; ASM: calll
15 entry:
16   %tmp17 = load i8, i8* getelementptr inbounds (%struct.S0, %struct.S0* @g_98, i32 0, i32 1, i32 0), align 4, !dbg !14
17   %tmp54 = zext i8 %tmp17 to i32, !dbg !15
18   %foo = load i32, i32* bitcast (i8* getelementptr inbounds (%struct.S0, %struct.S0* @g_98, i32 0, i32 1, i32 0) to i32*), align 4, !dbg !16
19 ; MIR: renamable $edi = MOVZX32rr8 renamable $al, debug-location !16
20   %conv.i = trunc i32 %foo to i8, !dbg !17
21
22   tail call void @func_12(i32 %tmp54, i8 zeroext %conv.i) #0, !dbg !18
23   call void @llvm.dbg.value(metadata i8 %tmp17, metadata !8, metadata !DIExpression()), !dbg !14
24   call void @llvm.dbg.value(metadata i32 %tmp54, metadata !10, metadata !DIExpression()), !dbg !15
25   call void @llvm.dbg.value(metadata i32 %foo, metadata !12, metadata !DIExpression()), !dbg !16
26   call void @llvm.dbg.value(metadata i8 %conv.i, metadata !13, metadata !DIExpression()), !dbg !17
27   ret void, !dbg !19
28 }
29
30 declare void @func_12(i32, i8 zeroext)
31
32 declare void @llvm.dbg.value(metadata, metadata, metadata)
33
34 !llvm.dbg.cu = !{!0}
35 !llvm.debugify = !{!3, !4}
36
37 !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "debugify", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
38 !1 = !DIFile(filename: "/Users/vsk/src/llvm.org-master/llvm/test/CodeGen/X86/fold-zext-trunc.ll", directory: "/")
39 !2 = !{}
40 !3 = !{i32 6}
41 !4 = !{i32 4}
42 !5 = distinct !DISubprogram(name: "foo", linkageName: "foo", scope: null, file: !1, line: 1, type: !6, isLocal: false, isDefinition: true, scopeLine: 1, isOptimized: true, unit: !0, retainedNodes: !7)
43 !6 = !DISubroutineType(types: !2)
44 !7 = !{!8, !10, !12, !13}
45 !8 = !DILocalVariable(name: "1", scope: !5, file: !1, line: 1, type: !9)
46 !9 = !DIBasicType(name: "ty8", size: 8, encoding: DW_ATE_unsigned)
47 !10 = !DILocalVariable(name: "2", scope: !5, file: !1, line: 2, type: !11)
48 !11 = !DIBasicType(name: "ty32", size: 32, encoding: DW_ATE_unsigned)
49 !12 = !DILocalVariable(name: "3", scope: !5, file: !1, line: 3, type: !11)
50 !13 = !DILocalVariable(name: "4", scope: !5, file: !1, line: 4, type: !9)
51 !14 = !DILocation(line: 1, column: 1, scope: !5)
52 !15 = !DILocation(line: 2, column: 1, scope: !5)
53 !16 = !DILocation(line: 3, column: 1, scope: !5)
54 !17 = !DILocation(line: 4, column: 1, scope: !5)
55 !18 = !DILocation(line: 5, column: 1, scope: !5)
56 !19 = !DILocation(line: 6, column: 1, scope: !5)
57 !20 = !{i32 2, !"Debug Info Version", i32 3}
58 !llvm.module.flags = !{!20}