1 ; RUN: opt -S -mergefunc < %s | FileCheck %s
3 ; We should not merge these two functions, because the blocks are different.
4 ; This tests the handling of block addresses from different functions.
6 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
7 target triple = "x86_64-unknown-linux-gnu"
10 define internal i8* @Afunc(i32* %P) {
17 ret i8* blockaddress(@_Z1fi, %if.then)
20 define internal i8* @Bfunc(i32* %P) {
27 ret i8* blockaddress(@_Z1fi, %if.then.2)
31 ; Function Attrs: nounwind uwtable
32 define i32 @_Z1fi(i32 %i) #0 {
34 %retval = alloca i32, align 4
35 %i.addr = alloca i32, align 4
36 store i32 %i, i32* %i.addr, align 4
37 %0 = load i32, i32* %i.addr, align 4
38 %cmp = icmp eq i32 %0, 1
39 br i1 %cmp, label %if.then, label %if.end
42 store i32 3, i32* %retval
46 %1 = load i32, i32* %i.addr, align 4
47 %cmp1 = icmp eq i32 %1, 3
48 br i1 %cmp1, label %if.then.2, label %if.end.3
51 store i32 56, i32* %retval
55 store i32 0, i32* %retval
59 %2 = load i32, i32* %retval