xref: /llvm-project/llvm/test/Transforms/InstCombine/alias-recursion.ll (revision 997d7d193149bdce5512405d7384f700c0cab39d)
1; RUN: opt < %s -passes=instcombine -S | FileCheck %s
2
3target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
4target triple = "x86_64-pc-windows-msvc"
5
6%class.A = type { ptr }
7
8@0 = constant [1 x ptr] zeroinitializer
9
10@vtbl = alias ptr, ptr @0
11
12define ptr @test(i1 %c1, i1 %c2) {
13; CHECK-LABEL: test
14entry:
15  br i1 %c1, label %for.body, label %for.end
16
17for.body:                                         ; preds = %for.body, %entry
18  br i1 %c2, label %for.body, label %for.end
19
20for.end:                                          ; preds = %for.body, %entry
21  %A = phi ptr [ @vtbl, %for.body ], [ null, %entry ]
22  %B = load ptr, ptr %A
23  ret ptr %B
24}
25