blob: 8e53995d57750345d239e6a877eadfe4c82d9aec [file] [log] [blame]
Michael Kupersteinbe8032c2014-12-23 11:33:41 +00001; RUN: opt < %s -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 { i32 (...)** }
7
8@0 = constant [1 x i8*] zeroinitializer
9
10@vtbl = alias getelementptr inbounds ([1 x i8*]* @0, i32 0, i32 0)
11
12define i32 (%class.A*)* @test() {
13; CHECK-LABEL: test
14entry:
15 br i1 undef, label %for.body, label %for.end
16
17for.body: ; preds = %for.body, %entry
18 br i1 undef, label %for.body, label %for.end
19
20for.end: ; preds = %for.body, %entry
21 %A = phi i32 (%class.A*)** [ bitcast (i8** @vtbl to i32 (%class.A*)**), %for.body ], [ null, %entry ]
David Blaikiea79ac142015-02-27 21:17:42 +000022 %B = load i32 (%class.A*)*, i32 (%class.A*)** %A
Michael Kupersteinbe8032c2014-12-23 11:33:41 +000023 ret i32 (%class.A*)* %B
24}