Home | History | Annotate | Download | only in MergeFunc
      1 ; RUN: opt -S -mergefunc < %s | FileCheck %s
      2 
      3 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
      4 target triple = "x86_64-unknown-linux-gnu"
      5 
      6 define i32 @_Z1fi(i32 %i) #0 {
      7 entry:
      8   %retval = alloca i32, align 4
      9   %i.addr = alloca i32, align 4
     10   store i32 %i, i32* %i.addr, align 4
     11   %0 = load i32, i32* %i.addr, align 4
     12   %cmp = icmp eq i32 %0, 1
     13   br i1 %cmp, label %if.then, label %if.end
     14 
     15 if.then:
     16   store i32 3, i32* %retval
     17   br label %return
     18 
     19 if.end:
     20   %1 = load i32, i32* %i.addr, align 4
     21   %cmp1 = icmp eq i32 %1, 3
     22   br i1 %cmp1, label %if.then.2, label %if.end.3
     23 
     24 if.then.2:
     25   store i32 56, i32* %retval
     26   br label %return
     27 
     28 if.end.3:
     29   store i32 0, i32* %retval
     30   br label %return
     31 
     32 return:
     33   %2 = load i32, i32* %retval
     34   ret i32 %2
     35 }
     36 
     37 
     38 define internal i8* @Afunc(i32* %P) {
     39   store i32 1, i32* %P
     40   store i32 3, i32* %P
     41   ret i8* blockaddress(@_Z1fi, %if.then.2)
     42 }
     43 
     44 define internal i8* @Bfunc(i32* %P) {
     45 ; CHECK-NOT: @Bfunc
     46   store i32 1, i32* %P
     47   store i32 3, i32* %P
     48   ret i8* blockaddress(@_Z1fi, %if.then.2)
     49 }
     50