1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -passes=simplifycfg -simplifycfg-require-and-preserve-domtree=1 < %s | FileCheck %s
4 @global = external global i16, align 1
5 @global.1 = external global i16, align 1
6 @global.2 = external global i16, align 1
8 define void @widget() {
9 ; CHECK-LABEL: @widget(
11 ; CHECK-NEXT: unreachable
14 %i = load i16, ptr @global, align 1
15 %i13 = icmp ne i16 %i, 0
16 br i1 %i13, label %bb16, label %bb14
19 %i15 = load i16, ptr @global.1, align 1
23 %i17 = load i16, ptr @global, align 1
24 %i18 = sdiv i16 2, %i17
25 %i19 = icmp ne i16 %i18, 0
26 %i20 = zext i1 %i19 to i16
27 %i21 = load i16, ptr @global.1, align 1
28 br i1 %i19, label %bb22, label %bb23
33 bb23: ; preds = %bb22, %bb16, %bb14
34 %i24 = phi i16 [ %i20, %bb22 ], [ %i21, %bb16 ], [ %i15, %bb14 ]
35 store i16 %i24, ptr @global.2, align 1