Home | History | Annotate | Download | only in Inline
      1 ; Inlining should not clone label annotations.
      2 ; Currently we block all duplication for simplicity.
      3 
      4 ; RUN: opt < %s -S -inline | FileCheck %s
      5 
      6 @the_global = global i32 0
      7 
      8 declare void @llvm.codeview.annotation(metadata)
      9 
     10 define void @inlinee() {
     11 entry:
     12   store i32 42, i32* @the_global
     13   call void @llvm.codeview.annotation(metadata !0)
     14   ret void
     15 }
     16 
     17 define void @caller() {
     18 entry:
     19   call void @inlinee()
     20   ret void
     21 }
     22 
     23 !0 = !{!"annotation"}
     24 
     25 ; CHECK-LABEL: define void @inlinee()
     26 ; CHECK: store i32 42, i32* @the_global
     27 ; CHECK: call void @llvm.codeview.annotation(metadata !0)
     28 ; CHECK: ret void
     29 
     30 ; CHECK-LABEL: define void @caller()
     31 ;       MSVC can inline this. If we ever do, check for the store but make sure
     32 ;       there is no annotation.
     33 ; CHECK: call void @inlinee()
     34 ; CHECK-NOT: call void @llvm.codeview.annotation
     35 ; CHECK: ret void
     36