Home | History | Annotate | Download | only in MergeFunc
      1 ; RUN: opt -mergefunc -S < %s | FileCheck %s
      2 
      3 ;; Make sure that two different sized allocas are not treated as equal.
      4 
      5 target datalayout = "e-m:w-p:32:32-i64:64-f80:32-n8:16:32-S32"
      6 
      7 %kv1 = type { i32, i32 }
      8 %kv2 = type { i8 }
      9 
     10 
     11 define void @a(i8 *%f) {
     12   %v = alloca %kv1, align 8
     13   %f_2 = bitcast i8* %f to void (%kv1 *)*
     14   call void %f_2(%kv1 * %v)
     15   call void %f_2(%kv1 * %v)
     16   call void %f_2(%kv1 * %v)
     17   call void %f_2(%kv1 * %v)
     18   ret void
     19 }
     20 
     21 ; CHECK-LABEL: define void @b
     22 ; CHECK-NOT: call @a
     23 ; CHECK: ret
     24 
     25 define void @b(i8 *%f) {
     26   %v = alloca %kv2, align 8
     27   %f_2 = bitcast i8* %f to void (%kv2 *)*
     28   call void %f_2(%kv2 * %v)
     29   call void %f_2(%kv2 * %v)
     30   call void %f_2(%kv2 * %v)
     31   call void %f_2(%kv2 * %v)
     32   ret void
     33 }
     34