summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/EarlyCSE/writeonly.ll
blob: 0a3cd1c7401ca73c80de34c949daf472cda54785 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
; RUN: opt -S -early-cse < %s | FileCheck %s

@var = global i32 undef
declare void @foo() nounwind

define void @test() {
; CHECK-LABEL: @test(
; CHECK-NOT: store
  store i32 1, i32* @var
; CHECK: call void @foo()
  call void @foo() writeonly
; CHECK: store i32 2, i32* @var
  store i32 2, i32* @var
  ret void
}
OpenPOWER on IntegriCloud