32 lines · plain
1; RUN: opt -passes=gvn-hoist -S < %s | FileCheck %s2 3; CHECK: store4; CHECK-NOT: store5 6; Check that an instruction can be hoisted to a basic block7; with more than two successors.8 9@G = external global i32, align 410 11define void @foo(i32 %c1) {12entry:13 switch i32 %c1, label %exit1 [14 i32 0, label %sw015 i32 1, label %sw116 ]17 18sw0:19 store i32 1, ptr @G20 br label %exit21 22sw1:23 store i32 1, ptr @G24 br label %exit25 26exit1:27 store i32 1, ptr @G28 ret void29exit:30 ret void31}32