aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms/GlobalOpt/2010-10-19-WeakOdr.ll
blob: ad5b440a5abe886828132239243d5df1fe5663e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
; RUN: opt < %s -globalopt -S | FileCheck %s

; PR8389: Globals with weak_odr linkage type must not be modified

; CHECK: weak_odr global i32 0

@SomeVar = weak_odr global i32 0

@llvm.global_ctors = appending global [1 x { i32, void ()* }] [ { i32, void ()* } { i32 65535, void ()* @CTOR } ]

define internal void @CTOR() {
  store i32 23, i32* @SomeVar
  ret void
}