Home | History | Annotate | Download | only in X86
      1 ; RUN: llc < %s -mtriple x86_64-apple-macosx10.8.0 -mcpu corei7 -filetype=obj -o - \
      2 ; RUN:  | llvm-objdump -triple x86_64-apple-macosx10.8.0 -s - \
      3 ; RUN:  | FileCheck -check-prefix=CU %s
      4 ; RUN: llc < %s -mtriple x86_64-apple-darwin11 -mcpu corei7 \
      5 ; RUN:  | llvm-mc -triple x86_64-apple-darwin11 -filetype=obj -o - \
      6 ; RUN:  | llvm-objdump -triple x86_64-apple-darwin11 -s - \
      7 ; RUN:  | FileCheck -check-prefix=FROM-ASM %s
      8 
      9 %"struct.dyld::MappedRanges" = type { [400 x %struct.anon], %"struct.dyld::MappedRanges"* }
     10 %struct.anon = type { %class.ImageLoader*, i64, i64 }
     11 %class.ImageLoader = type { i32 (...)**, i8*, i8*, i32, i64, i64, i32, i32, %"struct.ImageLoader::recursive_lock"*, i16, i16, [4 x i8] }
     12 %"struct.ImageLoader::recursive_lock" = type { i32, i32 }
     13 
     14 @G1 = external hidden global %"struct.dyld::MappedRanges", align 8
     15 
     16 declare void @OSMemoryBarrier() optsize
     17 
     18 ; This compact unwind encoding indicates that we could not generate correct
     19 ; compact unwind encodings for this function. This then defaults to using the
     20 ; DWARF EH frame.
     21 
     22 ; CU:      Contents of section __compact_unwind:
     23 ; CU-NEXT: 0048 00000000 00000000 42000000 00000004
     24 ; CU-NEXT: 0058 00000000 00000000 00000000 00000000
     25 
     26 ; FROM-ASM:      Contents of section __compact_unwind:
     27 ; FROM-ASM-NEXT: 0048 00000000 00000000 42000000 00000004
     28 ; FROM-ASM-NEXT: 0058 00000000 00000000 00000000 00000000
     29 
     30 define void @func(%class.ImageLoader* %image) optsize ssp uwtable {
     31 entry:
     32   br label %for.cond1.preheader
     33 
     34 for.cond1.preheader:                              ; preds = %for.inc10, %entry
     35   %p.019 = phi %"struct.dyld::MappedRanges"* [ @G1, %entry ], [ %1, %for.inc10 ]
     36   br label %for.body3
     37 
     38 for.body3:                                        ; preds = %for.inc, %for.cond1.preheader
     39   %indvars.iv = phi i64 [ 0, %for.cond1.preheader ], [ %indvars.iv.next, %for.inc ]
     40   %image4 = getelementptr inbounds %"struct.dyld::MappedRanges"* %p.019, i64 0, i32 0, i64 %indvars.iv, i32 0
     41   %0 = load %class.ImageLoader** %image4, align 8
     42   %cmp5 = icmp eq %class.ImageLoader* %0, %image
     43   br i1 %cmp5, label %if.then, label %for.inc
     44 
     45 if.then:                                          ; preds = %for.body3
     46   tail call void @OSMemoryBarrier() optsize
     47   store %class.ImageLoader* null, %class.ImageLoader** %image4, align 8
     48   br label %for.inc
     49 
     50 for.inc:                                          ; preds = %if.then, %for.body3
     51   %indvars.iv.next = add i64 %indvars.iv, 1
     52   %lftr.wideiv = trunc i64 %indvars.iv.next to i32
     53   %exitcond = icmp eq i32 %lftr.wideiv, 400
     54   br i1 %exitcond, label %for.inc10, label %for.body3
     55 
     56 for.inc10:                                        ; preds = %for.inc
     57   %next = getelementptr inbounds %"struct.dyld::MappedRanges"* %p.019, i64 0, i32 1
     58   %1 = load %"struct.dyld::MappedRanges"** %next, align 8
     59   %cmp = icmp eq %"struct.dyld::MappedRanges"* %1, null
     60   br i1 %cmp, label %for.end11, label %for.cond1.preheader
     61 
     62 for.end11:                                        ; preds = %for.inc10
     63   ret void
     64 }
     65