Home | History | Annotate | Download | only in DebugIR
      1 ; ModuleID = 'function.c'
      2 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
      3 target triple = "x86_64-pc-linux-gnu"
      4 
      5 ; Function Attrs: nounwind uwtable
      6 define void @blah(i32* %i) #0 {
      7   %1 = alloca i32*, align 8                   ; CHECK: !dbg
      8   store i32* %i, i32** %1, align 8            ; CHECK-NEXT: !dbg
      9   %2 = load i32** %1, align 8                 ; CHECK-NEXT: !dbg
     10   %3 = load i32* %2, align 4                  ; CHECK-NEXT: !dbg
     11   %4 = add nsw i32 %3, 1                      ; CHECK-NEXT: !dbg
     12   store i32 %4, i32* %2, align 4              ; CHECK-NEXT: !dbg
     13   ret void                                    ; CHECK-NEXT: !dbg
     14 }
     15 
     16 ; Function Attrs: nounwind uwtable
     17 define i32 @main(i32 %argc, i8** %argv) #0 {
     18   %1 = alloca i32, align 4                    ; CHECK: !dbg
     19   %2 = alloca i32, align 4                    ; CHECK-NEXT: !dbg
     20   %3 = alloca i8**, align 8                   ; CHECK-NEXT: !dbg
     21   %i = alloca i32, align 4                    ; CHECK-NEXT: !dbg
     22   store i32 0, i32* %1                        ; CHECK-NEXT: !dbg
     23   store i32 %argc, i32* %2, align 4           ; CHECK-NEXT: !dbg
     24   store i8** %argv, i8*** %3, align 8         ; CHECK-NEXT: !dbg
     25   store i32 7, i32* %i, align 4               ; CHECK-NEXT: !dbg
     26   call void @blah(i32* %i)                    ; CHECK-NEXT: !dbg
     27   %4 = load i32* %i, align 4                  ; CHECK-NEXT: !dbg
     28   ret i32 %4                                  ; CHECK-NEXT: !dbg
     29 }
     30 
     31 attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf"="true" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
     32 ; CHECK: = metadata !{i32 8,
     33 ; CHECK-NEXT: = metadata !{i32 9,
     34 ; CHECK-NEXT: = metadata !{i32 10,
     35 ; CHECK-NEXT: = metadata !{i32 11,
     36 ; CHECK-NEXT: = metadata !{i32 12,
     37 ; CHECK-NEXT: = metadata !{i32 13,
     38 
     39 ; CHECK-NEXT: = metadata !{i32 18,
     40 ; CHECK-NEXT: = metadata !{i32 19,
     41 ; CHECK-NEXT: = metadata !{i32 20,
     42 ; CHECK-NEXT: = metadata !{i32 21,
     43 ; CHECK-NEXT: = metadata !{i32 22,
     44 ; CHECK-NEXT: = metadata !{i32 23,
     45 ; CHECK-NEXT: = metadata !{i32 24,
     46 ; CHECK-NEXT: = metadata !{i32 25,
     47 ; CHECK-NEXT: = metadata !{i32 26,
     48 ; CHECK-NEXT: = metadata !{i32 27,
     49 ; CHECK-NEXT: = metadata !{i32 28,
     50 
     51 ; RUN: opt %s -debug-ir -S | FileCheck %s
     52