Advertisement
Guest User

without -O2

a guest
Oct 14th, 2015
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
LLVM 4.70 KB | None | 0 0
  1. ; ModuleID = 'test.c'
  2. target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
  3. target triple = "x86_64-unknown-linux-gnu"
  4.  
  5. ; Function Attrs: nounwind uwtable
  6. define i32 @main(i32 %argc, i8** %argv) #0 {
  7. entry:
  8.   %retval = alloca i32, align 4
  9.   %argc.addr = alloca i32, align 4
  10.   %argv.addr = alloca i8**, align 8
  11.   %dup = alloca i8*, align 8
  12.   store i32 0, i32* %retval, align 4
  13.   store i32 %argc, i32* %argc.addr, align 4
  14.   call void @llvm.dbg.declare(metadata i32* %argc.addr, metadata !14, metadata !15), !dbg !16
  15.   store i8** %argv, i8*** %argv.addr, align 8
  16.   call void @llvm.dbg.declare(metadata i8*** %argv.addr, metadata !17, metadata !15), !dbg !18
  17.   call void @llvm.dbg.declare(metadata i8** %dup, metadata !19, metadata !15), !dbg !20
  18.   store i8* null, i8** %dup, align 8, !dbg !20
  19.   %0 = load i32, i32* %argc.addr, align 4, !dbg !21
  20.   %cmp = icmp eq i32 %0, 2, !dbg !23
  21.   br i1 %cmp, label %if.then, label %if.end, !dbg !24
  22.  
  23. if.then:                                          ; preds = %entry
  24.   %1 = load i8**, i8*** %argv.addr, align 8, !dbg !25
  25.   %arrayidx = getelementptr inbounds i8*, i8** %1, i64 1, !dbg !25
  26.   %2 = load i8*, i8** %arrayidx, align 8, !dbg !25
  27.   %call = call noalias i8* @strdup(i8* %2) #3, !dbg !27
  28.   store i8* %call, i8** %dup, align 8, !dbg !28
  29.   br label %if.end, !dbg !29
  30.  
  31. if.end:                                           ; preds = %if.then, %entry
  32.   ret i32 0, !dbg !30
  33. }
  34.  
  35. ; Function Attrs: nounwind readnone
  36. declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
  37.  
  38. ; Function Attrs: nounwind
  39. declare noalias i8* @strdup(i8*) #2
  40.  
  41. attributes #0 = { nounwind uwtable "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-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" }
  42. attributes #1 = { nounwind readnone }
  43. attributes #2 = { nounwind "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-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" }
  44. attributes #3 = { nounwind }
  45.  
  46. !llvm.dbg.cu = !{!0}
  47. !llvm.module.flags = !{!11, !12}
  48. !llvm.ident = !{!13}
  49.  
  50. !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.8.0 (git@github.com:llvm-mirror/clang.git 33e8a9bf1ce3556c395d94c66ea83f6f5f06f2bf) (git@github.com:llvm-mirror/llvm.git 9dd7e2da2a6e6e68c04162ecc9df00e3fd84dc61)", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, subprograms: !3)
  51. !1 = !DIFile(filename: "test.c", directory: "/home/carr27/dataconf-workspace2/data-integrity-tests/simple-types/strdup")
  52. !2 = !{}
  53. !3 = !{!4}
  54. !4 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 3, type: !5, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: false, function: i32 (i32, i8**)* @main, variables: !2)
  55. !5 = !DISubroutineType(types: !6)
  56. !6 = !{!7, !7, !8}
  57. !7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
  58. !8 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !9, size: 64, align: 64)
  59. !9 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !10, size: 64, align: 64)
  60. !10 = !DIBasicType(name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char)
  61. !11 = !{i32 2, !"Dwarf Version", i32 4}
  62. !12 = !{i32 2, !"Debug Info Version", i32 3}
  63. !13 = !{!"clang version 3.8.0 (git@github.com:llvm-mirror/clang.git 33e8a9bf1ce3556c395d94c66ea83f6f5f06f2bf) (git@github.com:llvm-mirror/llvm.git 9dd7e2da2a6e6e68c04162ecc9df00e3fd84dc61)"}
  64. !14 = !DILocalVariable(name: "argc", arg: 1, scope: !4, file: !1, line: 3, type: !7)
  65. !15 = !DIExpression()
  66. !16 = !DILocation(line: 3, column: 14, scope: !4)
  67. !17 = !DILocalVariable(name: "argv", arg: 2, scope: !4, file: !1, line: 3, type: !8)
  68. !18 = !DILocation(line: 3, column: 27, scope: !4)
  69. !19 = !DILocalVariable(name: "dup", scope: !4, file: !1, line: 4, type: !9)
  70. !20 = !DILocation(line: 4, column: 9, scope: !4)
  71. !21 = !DILocation(line: 5, column: 7, scope: !22)
  72. !22 = distinct !DILexicalBlock(scope: !4, file: !1, line: 5, column: 7)
  73. !23 = !DILocation(line: 5, column: 12, scope: !22)
  74. !24 = !DILocation(line: 5, column: 7, scope: !4)
  75. !25 = !DILocation(line: 6, column: 18, scope: !26)
  76. !26 = distinct !DILexicalBlock(scope: !22, file: !1, line: 5, column: 18)
  77. !27 = !DILocation(line: 6, column: 11, scope: !26)
  78. !28 = !DILocation(line: 6, column: 9, scope: !26)
  79. !29 = !DILocation(line: 7, column: 3, scope: !26)
  80. !30 = !DILocation(line: 8, column: 3, scope: !4)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement