summaryrefslogtreecommitdiffstats
path: root/test/CodeGen/X86/ga-offset.ll
blob: aaa2f84b88c94789942d705b4d45ee8b83a55452 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
; RUN: llvm-as < %s | llc -march=x86 > %t
; RUN: not grep lea %t
; RUN: not grep add %t
; RUN: grep mov %t | count 1
; RUN: llvm-as < %s | llc -mtriple=x86_64-linux -relocation-model=static > %t
; RUN: not grep lea %t
; RUN: not grep add %t
; RUN: grep mov %t | count 1

; This store should fold to a single mov instruction.

@ptr = global i32* null
@dst = global [131072 x i32] zeroinitializer

define void @foo() nounwind {
  store i32* getelementptr ([131072 x i32]* @dst, i32 0, i32 16), i32** @ptr
  ret void
}
OpenPOWER on IntegriCloud