• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt -S -mergefunc < %s | FileCheck %s
2
3target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
4target triple = "x86_64-unknown-linux-gnu"
5
6define i32 @_Z1fi(i32 %i) #0 {
7entry:
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
15if.then:
16  store i32 3, i32* %retval
17  br label %return
18
19if.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
24if.then.2:
25  store i32 56, i32* %retval
26  br label %return
27
28if.end.3:
29  store i32 0, i32* %retval
30  br label %return
31
32return:
33  %2 = load i32, i32* %retval
34  ret i32 %2
35}
36
37
38define 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
44define 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