1 ; RUN: opt -S -passes=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 ptr @Afunc(ptr %P) {
17 ret ptr blockaddress(@_Z1fi, %if.then)
20 define internal ptr @Bfunc(ptr %P) {
27 ret ptr 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, ptr %i.addr, align 4
37 %0 = load i32, ptr %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, ptr %retval
46 %1 = load i32, ptr %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, ptr %retval
55 store i32 0, ptr %retval
59 %2 = load i32, ptr %retval