1 ; RUN: opt < %s -passes=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 = load i32, ptr undef, align 4
9 target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
11 %s = type { i32, ptr, [3 x i8], i8 }
17 cond.end118: ; preds = %entry
18 br i1 undef, label %cleanup, label %if.end155
20 if.end155: ; preds = %cond.end118
23 while.cond: ; preds = %while.body, %if.end155
24 br i1 undef, label %while.end, label %while.body
26 while.body: ; preds = %while.cond
29 while.end: ; preds = %while.cond
30 switch i32 undef, label %if.else218 [
32 i32 0, label %if.then174
35 if.then174: ; preds = %while.end
38 if.else218: ; preds = %while.end
39 br i1 undef, label %if.then226, label %if.else326
41 if.then226: ; preds = %if.else218
42 %0 = load i32, ptr undef, align 4
45 if.else326: ; preds = %if.else218
46 %1 = load i32, ptr undef, align 4
49 cleanup: ; preds = %while.end, %cond.end118