blob: 6956faabc3365c36930d65e72d15189f18ad0198 [file] [log] [blame]
Chris Lattnerc7d7e0c2010-05-08 22:15:59 +00001; RUN: opt < %s -simplifycfg -S | FileCheck %s
Chris Lattnerf8131c92008-10-29 17:46:26 +00002; PR2967
3
4target datalayout =
5"e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32"
6target triple = "i386-pc-linux-gnu"
7
Chris Lattnerc7d7e0c2010-05-08 22:15:59 +00008define void @test1(i32 %x) nounwind {
Chris Lattnerf8131c92008-10-29 17:46:26 +00009entry:
10 %0 = icmp eq i32 %x, 0 ; <i1> [#uses=1]
11 br i1 %0, label %bb, label %return
12
13bb: ; preds = %entry
Chris Lattnerc7d7e0c2010-05-08 22:15:59 +000014 %1 = volatile load i32* null
Chris Lattnerf8131c92008-10-29 17:46:26 +000015 unreachable
Chris Lattnerc7d7e0c2010-05-08 22:15:59 +000016
Chris Lattnerf8131c92008-10-29 17:46:26 +000017 br label %return
18return: ; preds = %entry
19 ret void
Chris Lattnerc7d7e0c2010-05-08 22:15:59 +000020; CHECK: @test1
21; CHECK: volatile load
22}
23
24; rdar://7958343
25define void @test2() nounwind {
26entry:
27 store i32 4,i32* null
28 ret void
29
30; CHECK: @test2
31; CHECK: call void @llvm.trap
32; CHECK: unreachable
Chris Lattnerf8131c92008-10-29 17:46:26 +000033}