1 ; RUN: opt < %s -gvn-hoist -S | FileCheck %s
3 ; This test is meant to make sure that MemorySSAUpdater works correctly
4 ; in non-trivial cases.
7 ; CHECK-NEXT: %0 = getelementptr inbounds %s, %s* undef, i32 0, i32 0
8 ; CHECK-NEXT: %1 = load i32, i32* %0, align 4
10 target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
12 %s = type { i32, %s**, [3 x i8], i8 }
18 cond.end118: ; preds = %entry
19 br i1 undef, label %cleanup, label %if.end155
21 if.end155: ; preds = %cond.end118
24 while.cond: ; preds = %while.body, %if.end155
25 br i1 undef, label %while.end, label %while.body
27 while.body: ; preds = %while.cond
30 while.end: ; preds = %while.cond
31 switch i32 undef, label %if.else218 [
33 i32 0, label %if.then174
36 if.then174: ; preds = %while.end
39 if.else218: ; preds = %while.end
40 br i1 undef, label %if.then226, label %if.else326
42 if.then226: ; preds = %if.else218
43 %size227 = getelementptr inbounds %s, %s* undef, i32 0, i32 0
44 %0 = load i32, i32* %size227, align 4
47 if.else326: ; preds = %if.else218
48 %size330 = getelementptr inbounds %s, %s* undef, i32 0, i32 0
49 %1 = load i32, i32* %size330, align 4
52 cleanup: ; preds = %while.end, %cond.end118