1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00
llvm-mirror/test/Transforms/SimplifyCFG/trapping-load-unreachable.ll
Eli Friedman baf0f69f9a Move "atomic" and "volatile" designations on instructions after the opcode
of the instruction.

Note that this change affects the existing non-atomic load and store
instructions; the parser now accepts both forms, and the change is noted
in the release notes.

llvm-svn: 137527
2011-08-12 22:50:01 +00:00

45 lines
905 B
LLVM

; RUN: opt < %s -simplifycfg -S | FileCheck %s
; PR2967
target datalayout =
"e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32"
target triple = "i386-pc-linux-gnu"
define void @test1(i32 %x) nounwind {
entry:
%0 = icmp eq i32 %x, 0 ; <i1> [#uses=1]
br i1 %0, label %bb, label %return
bb: ; preds = %entry
%1 = load volatile i32* null
unreachable
br label %return
return: ; preds = %entry
ret void
; CHECK: @test1
; CHECK: load volatile
}
; rdar://7958343
define void @test2() nounwind {
entry:
store i32 4,i32* null
ret void
; CHECK: @test2
; CHECK: call void @llvm.trap
; CHECK: unreachable
}
; PR7369
define void @test3() nounwind {
entry:
store volatile i32 4, i32* null
ret void
; CHECK: @test3
; CHECK: store volatile i32 4, i32* null
; CHECK: ret
}