47 lines · plain
1;RUN: opt -S -passes=globalopt -f %s | FileCheck %s2 3;CHECK: @foo = {{.*}}, !dbg !04@foo = global i64 ptrtoint (ptr @baa to i64), align 8, !dbg !05@baa = common global [1 x i64] zeroinitializer, align 8, !dbg !66 7; Function Attrs: noinline nounwind optnone uwtable8define void @fun() #0 !dbg !16 {9entry:10 %0 = load i64, ptr @foo, align 8, !dbg !1911 %1 = inttoptr i64 %0 to ptr, !dbg !1912 %cmp = icmp ugt ptr @baa, %1, !dbg !2013 %conv = zext i1 %cmp to i32, !dbg !2014 store i64 0, ptr @foo, align 8, !dbg !2115 ret void, !dbg !2216}17 18attributes #0 = { noinline nounwind optnone uwtable }19 20!llvm.dbg.cu = !{!2}21!llvm.module.flags = !{!12, !13, !14}22!llvm.ident = !{!15}23 24!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())25!1 = distinct !DIGlobalVariable(name: "foo", scope: !2, file: !3, line: 2, type: !9, isLocal: false, isDefinition: true)26!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 6.0.0 ", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5)27!3 = !DIFile(filename: "shrink-address-to-bool.c", directory: "/")28!4 = !{}29!5 = !{!0, !6}30!6 = !DIGlobalVariableExpression(var: !7, expr: !DIExpression())31!7 = distinct !DIGlobalVariable(name: "baa", scope: !2, file: !3, line: 1, type: !8, isLocal: false, isDefinition: true)32!8 = !DICompositeType(tag: DW_TAG_array_type, baseType: !9, size: 64, elements: !10)33!9 = !DIBasicType(name: "long int", size: 64, encoding: DW_ATE_signed)34!10 = !{!11}35!11 = !DISubrange(count: 1)36!12 = !{i32 2, !"Dwarf Version", i32 4}37!13 = !{i32 2, !"Debug Info Version", i32 3}38!14 = !{i32 1, !"wchar_size", i32 4}39!15 = !{!"clang version 6.0.0 "}40!16 = distinct !DISubprogram(name: "fun", scope: !3, file: !3, line: 4, type: !17, isLocal: false, isDefinition: true, scopeLine: 4, isOptimized: false, unit: !2, retainedNodes: !4)41!17 = !DISubroutineType(types: !18)42!18 = !{null}43!19 = !DILocation(line: 5, column: 9, scope: !16)44!20 = !DILocation(line: 5, column: 7, scope: !16)45!21 = !DILocation(line: 6, column: 7, scope: !16)46!22 = !DILocation(line: 7, column: 1, scope: !16)47