| Dan Gohman | 2c74fe9 | 2017-11-08 21:59:51 +0000 | [diff] [blame] | 1 | ; RUN: opt -S < %s -globalopt | FileCheck %s |
| 2 | |||||
| 3 | ; Static evaluation across a @llvm.sideeffect. | ||||
| 4 | |||||
| 5 | ; CHECK-NOT: store | ||||
| 6 | |||||
| 7 | declare void @llvm.sideeffect() | ||||
| 8 | |||||
| 9 | @llvm.global_ctors = appending global [1 x { i32, void ()* }] [ { i32, void ()* } { i32 65535, void ()* @ctor } ] | ||||
| 10 | @G = global i32 0 | ||||
| 11 | |||||
| 12 | define internal void @ctor() { | ||||
| 13 | store i32 1, i32* @G | ||||
| 14 | call void @llvm.sideeffect() | ||||
| 15 | ret void | ||||
| 16 | } | ||||