blob: 62b8a8c7a5b4902bd82a0decd7cc8c78a8ce26b0 [file] [log] [blame]
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -mcpu=generic -mtriple=x86_64-unknown-linux-gnu -relocation-model=static -code-model=small -pre-RA-sched=list-ilp | FileCheck %s -check-prefix=LINUX-64-STATIC
; RUN: llc < %s -mcpu=generic -mtriple=i686-unknown-linux-gnu -relocation-model=static -code-model=small -pre-RA-sched=list-ilp | FileCheck %s -check-prefix=LINUX-32-STATIC
; RUN: llc < %s -mcpu=generic -mtriple=i686-unknown-linux-gnu -relocation-model=static -code-model=small -pre-RA-sched=list-ilp | FileCheck %s -check-prefix=LINUX-32-PIC
; RUN: llc < %s -mcpu=generic -mtriple=x86_64-unknown-linux-gnu -relocation-model=pic -code-model=small -pre-RA-sched=list-ilp | FileCheck %s -check-prefix=LINUX-64-PIC
; RUN: llc < %s -mcpu=generic -mtriple=i686-apple-darwin -relocation-model=static -code-model=small -pre-RA-sched=list-ilp | FileCheck %s -check-prefix=DARWIN-32-STATIC
; RUN: llc < %s -mcpu=generic -mtriple=i686-apple-darwin9 -relocation-model=dynamic-no-pic -code-model=small -pre-RA-sched=list-ilp | FileCheck %s -check-prefix=DARWIN-32-DYNAMIC
; RUN: llc < %s -mcpu=generic -mtriple=i686-apple-darwin9 -relocation-model=pic -code-model=small -pre-RA-sched=list-ilp | FileCheck %s -check-prefix=DARWIN-32-PIC
; RUN: llc < %s -mcpu=generic -mtriple=x86_64-apple-darwin -relocation-model=static -code-model=small -pre-RA-sched=list-ilp | FileCheck %s -check-prefix=DARWIN-64-STATIC
; RUN: llc < %s -mcpu=generic -mtriple=x86_64-apple-darwin -relocation-model=dynamic-no-pic -code-model=small -pre-RA-sched=list-ilp | FileCheck %s -check-prefix=DARWIN-64-DYNAMIC
; RUN: llc < %s -mcpu=generic -mtriple=x86_64-apple-darwin -relocation-model=pic -code-model=small -pre-RA-sched=list-ilp | FileCheck %s -check-prefix=DARWIN-64-PIC
@src = external global [131072 x i32]
@dst = external global [131072 x i32]
@xsrc = external global [32 x i32]
@xdst = external global [32 x i32]
@ptr = external global i32*
@dsrc = global [131072 x i32] zeroinitializer, align 32
@ddst = global [131072 x i32] zeroinitializer, align 32
@dptr = global i32* null
@lsrc = internal global [131072 x i32] zeroinitializer
@ldst = internal global [131072 x i32] zeroinitializer
@lptr = internal global i32* null
@ifunc = external global void ()*
@difunc = global void ()* null
@lifunc = internal global void ()* null
@lxsrc = internal global [32 x i32] zeroinitializer, align 32
@lxdst = internal global [32 x i32] zeroinitializer, align 32
@dxsrc = global [32 x i32] zeroinitializer, align 32
@dxdst = global [32 x i32] zeroinitializer, align 32
define void @foo00() nounwind {
; LINUX-64-STATIC-LABEL: foo00:
; LINUX-64-STATIC: # %bb.0: # %entry
; LINUX-64-STATIC-NEXT: movl src(%rip), %eax
; LINUX-64-STATIC-NEXT: movl %eax, dst(%rip)
; LINUX-64-STATIC-NEXT: retq
;
; LINUX-32-STATIC-LABEL: foo00:
; LINUX-32-STATIC: # %bb.0: # %entry
; LINUX-32-STATIC-NEXT: movl src, %eax
; LINUX-32-STATIC-NEXT: movl %eax, dst
; LINUX-32-STATIC-NEXT: retl
;
; LINUX-32-PIC-LABEL: foo00:
; LINUX-32-PIC: # %bb.0: # %entry
; LINUX-32-PIC-NEXT: movl src, %eax
; LINUX-32-PIC-NEXT: movl %eax, dst
; LINUX-32-PIC-NEXT: retl
;
; LINUX-64-PIC-LABEL: foo00:
; LINUX-64-PIC: # %bb.0: # %entry
; LINUX-64-PIC-NEXT: movq src@GOTPCREL(%rip), %rax
; LINUX-64-PIC-NEXT: movl (%rax), %eax
; LINUX-64-PIC-NEXT: movq dst@GOTPCREL(%rip), %rcx
; LINUX-64-PIC-NEXT: movl %eax, (%rcx)
; LINUX-64-PIC-NEXT: retq
;
; DARWIN-32-STATIC-LABEL: foo00:
; DARWIN-32-STATIC: ## %bb.0: ## %entry
; DARWIN-32-STATIC-NEXT: movl _src, %eax
; DARWIN-32-STATIC-NEXT: movl %eax, _dst
; DARWIN-32-STATIC-NEXT: retl
;
; DARWIN-32-DYNAMIC-LABEL: foo00:
; DARWIN-32-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-32-DYNAMIC-NEXT: movl L_src$non_lazy_ptr, %eax
; DARWIN-32-DYNAMIC-NEXT: movl (%eax), %eax
; DARWIN-32-DYNAMIC-NEXT: movl L_dst$non_lazy_ptr, %ecx
; DARWIN-32-DYNAMIC-NEXT: movl %eax, (%ecx)
; DARWIN-32-DYNAMIC-NEXT: retl
;
; DARWIN-32-PIC-LABEL: foo00:
; DARWIN-32-PIC: ## %bb.0: ## %entry
; DARWIN-32-PIC-NEXT: calll L0$pb
; DARWIN-32-PIC-NEXT: L0$pb:
; DARWIN-32-PIC-NEXT: popl %eax
; DARWIN-32-PIC-NEXT: movl L_src$non_lazy_ptr-L0$pb(%eax), %ecx
; DARWIN-32-PIC-NEXT: movl (%ecx), %ecx
; DARWIN-32-PIC-NEXT: movl L_dst$non_lazy_ptr-L0$pb(%eax), %eax
; DARWIN-32-PIC-NEXT: movl %ecx, (%eax)
; DARWIN-32-PIC-NEXT: retl
;
; DARWIN-64-STATIC-LABEL: foo00:
; DARWIN-64-STATIC: ## %bb.0: ## %entry
; DARWIN-64-STATIC-NEXT: movq _src@GOTPCREL(%rip), %rax
; DARWIN-64-STATIC-NEXT: movl (%rax), %eax
; DARWIN-64-STATIC-NEXT: movq _dst@GOTPCREL(%rip), %rcx
; DARWIN-64-STATIC-NEXT: movl %eax, (%rcx)
; DARWIN-64-STATIC-NEXT: retq
;
; DARWIN-64-DYNAMIC-LABEL: foo00:
; DARWIN-64-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-64-DYNAMIC-NEXT: movq _src@GOTPCREL(%rip), %rax
; DARWIN-64-DYNAMIC-NEXT: movl (%rax), %eax
; DARWIN-64-DYNAMIC-NEXT: movq _dst@GOTPCREL(%rip), %rcx
; DARWIN-64-DYNAMIC-NEXT: movl %eax, (%rcx)
; DARWIN-64-DYNAMIC-NEXT: retq
;
; DARWIN-64-PIC-LABEL: foo00:
; DARWIN-64-PIC: ## %bb.0: ## %entry
; DARWIN-64-PIC-NEXT: movq _src@GOTPCREL(%rip), %rax
; DARWIN-64-PIC-NEXT: movl (%rax), %eax
; DARWIN-64-PIC-NEXT: movq _dst@GOTPCREL(%rip), %rcx
; DARWIN-64-PIC-NEXT: movl %eax, (%rcx)
; DARWIN-64-PIC-NEXT: retq
entry:
%0 = load i32, i32* getelementptr ([131072 x i32], [131072 x i32]* @src, i32 0, i64 0), align 4
store i32 %0, i32* getelementptr ([131072 x i32], [131072 x i32]* @dst, i32 0, i64 0), align 4
ret void
}
define void @fxo00() nounwind {
; LINUX-64-STATIC-LABEL: fxo00:
; LINUX-64-STATIC: # %bb.0: # %entry
; LINUX-64-STATIC-NEXT: movl xsrc(%rip), %eax
; LINUX-64-STATIC-NEXT: movl %eax, xdst(%rip)
; LINUX-64-STATIC-NEXT: retq
;
; LINUX-32-STATIC-LABEL: fxo00:
; LINUX-32-STATIC: # %bb.0: # %entry
; LINUX-32-STATIC-NEXT: movl xsrc, %eax
; LINUX-32-STATIC-NEXT: movl %eax, xdst
; LINUX-32-STATIC-NEXT: retl
;
; LINUX-32-PIC-LABEL: fxo00:
; LINUX-32-PIC: # %bb.0: # %entry
; LINUX-32-PIC-NEXT: movl xsrc, %eax
; LINUX-32-PIC-NEXT: movl %eax, xdst
; LINUX-32-PIC-NEXT: retl
;
; LINUX-64-PIC-LABEL: fxo00:
; LINUX-64-PIC: # %bb.0: # %entry
; LINUX-64-PIC-NEXT: movq xsrc@GOTPCREL(%rip), %rax
; LINUX-64-PIC-NEXT: movl (%rax), %eax
; LINUX-64-PIC-NEXT: movq xdst@GOTPCREL(%rip), %rcx
; LINUX-64-PIC-NEXT: movl %eax, (%rcx)
; LINUX-64-PIC-NEXT: retq
;
; DARWIN-32-STATIC-LABEL: fxo00:
; DARWIN-32-STATIC: ## %bb.0: ## %entry
; DARWIN-32-STATIC-NEXT: movl _xsrc, %eax
; DARWIN-32-STATIC-NEXT: movl %eax, _xdst
; DARWIN-32-STATIC-NEXT: retl
;
; DARWIN-32-DYNAMIC-LABEL: fxo00:
; DARWIN-32-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-32-DYNAMIC-NEXT: movl L_xsrc$non_lazy_ptr, %eax
; DARWIN-32-DYNAMIC-NEXT: movl (%eax), %eax
; DARWIN-32-DYNAMIC-NEXT: movl L_xdst$non_lazy_ptr, %ecx
; DARWIN-32-DYNAMIC-NEXT: movl %eax, (%ecx)
; DARWIN-32-DYNAMIC-NEXT: retl
;
; DARWIN-32-PIC-LABEL: fxo00:
; DARWIN-32-PIC: ## %bb.0: ## %entry
; DARWIN-32-PIC-NEXT: calll L1$pb
; DARWIN-32-PIC-NEXT: L1$pb:
; DARWIN-32-PIC-NEXT: popl %eax
; DARWIN-32-PIC-NEXT: movl L_xsrc$non_lazy_ptr-L1$pb(%eax), %ecx
; DARWIN-32-PIC-NEXT: movl (%ecx), %ecx
; DARWIN-32-PIC-NEXT: movl L_xdst$non_lazy_ptr-L1$pb(%eax), %eax
; DARWIN-32-PIC-NEXT: movl %ecx, (%eax)
; DARWIN-32-PIC-NEXT: retl
;
; DARWIN-64-STATIC-LABEL: fxo00:
; DARWIN-64-STATIC: ## %bb.0: ## %entry
; DARWIN-64-STATIC-NEXT: movq _xsrc@GOTPCREL(%rip), %rax
; DARWIN-64-STATIC-NEXT: movl (%rax), %eax
; DARWIN-64-STATIC-NEXT: movq _xdst@GOTPCREL(%rip), %rcx
; DARWIN-64-STATIC-NEXT: movl %eax, (%rcx)
; DARWIN-64-STATIC-NEXT: retq
;
; DARWIN-64-DYNAMIC-LABEL: fxo00:
; DARWIN-64-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-64-DYNAMIC-NEXT: movq _xsrc@GOTPCREL(%rip), %rax
; DARWIN-64-DYNAMIC-NEXT: movl (%rax), %eax
; DARWIN-64-DYNAMIC-NEXT: movq _xdst@GOTPCREL(%rip), %rcx
; DARWIN-64-DYNAMIC-NEXT: movl %eax, (%rcx)
; DARWIN-64-DYNAMIC-NEXT: retq
;
; DARWIN-64-PIC-LABEL: fxo00:
; DARWIN-64-PIC: ## %bb.0: ## %entry
; DARWIN-64-PIC-NEXT: movq _xsrc@GOTPCREL(%rip), %rax
; DARWIN-64-PIC-NEXT: movl (%rax), %eax
; DARWIN-64-PIC-NEXT: movq _xdst@GOTPCREL(%rip), %rcx
; DARWIN-64-PIC-NEXT: movl %eax, (%rcx)
; DARWIN-64-PIC-NEXT: retq
entry:
%0 = load i32, i32* getelementptr ([32 x i32], [32 x i32]* @xsrc, i32 0, i64 0), align 4
store i32 %0, i32* getelementptr ([32 x i32], [32 x i32]* @xdst, i32 0, i64 0), align 4
ret void
}
define void @foo01() nounwind {
; LINUX-64-STATIC-LABEL: foo01:
; LINUX-64-STATIC: # %bb.0: # %entry
; LINUX-64-STATIC-NEXT: movq $dst, ptr(%rip)
; LINUX-64-STATIC-NEXT: retq
;
; LINUX-32-STATIC-LABEL: foo01:
; LINUX-32-STATIC: # %bb.0: # %entry
; LINUX-32-STATIC-NEXT: movl $dst, ptr
; LINUX-32-STATIC-NEXT: retl
;
; LINUX-32-PIC-LABEL: foo01:
; LINUX-32-PIC: # %bb.0: # %entry
; LINUX-32-PIC-NEXT: movl $dst, ptr
; LINUX-32-PIC-NEXT: retl
;
; LINUX-64-PIC-LABEL: foo01:
; LINUX-64-PIC: # %bb.0: # %entry
; LINUX-64-PIC-NEXT: movq dst@GOTPCREL(%rip), %rax
; LINUX-64-PIC-NEXT: movq ptr@GOTPCREL(%rip), %rcx
; LINUX-64-PIC-NEXT: movq %rax, (%rcx)
; LINUX-64-PIC-NEXT: retq
;
; DARWIN-32-STATIC-LABEL: foo01:
; DARWIN-32-STATIC: ## %bb.0: ## %entry
; DARWIN-32-STATIC-NEXT: movl $_dst, _ptr
; DARWIN-32-STATIC-NEXT: retl
;
; DARWIN-32-DYNAMIC-LABEL: foo01:
; DARWIN-32-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-32-DYNAMIC-NEXT: movl L_dst$non_lazy_ptr, %eax
; DARWIN-32-DYNAMIC-NEXT: movl L_ptr$non_lazy_ptr, %ecx
; DARWIN-32-DYNAMIC-NEXT: movl %eax, (%ecx)
; DARWIN-32-DYNAMIC-NEXT: retl
;
; DARWIN-32-PIC-LABEL: foo01:
; DARWIN-32-PIC: ## %bb.0: ## %entry
; DARWIN-32-PIC-NEXT: calll L2$pb
; DARWIN-32-PIC-NEXT: L2$pb:
; DARWIN-32-PIC-NEXT: popl %eax
; DARWIN-32-PIC-NEXT: movl L_dst$non_lazy_ptr-L2$pb(%eax), %ecx
; DARWIN-32-PIC-NEXT: movl L_ptr$non_lazy_ptr-L2$pb(%eax), %eax
; DARWIN-32-PIC-NEXT: movl %ecx, (%eax)
; DARWIN-32-PIC-NEXT: retl
;
; DARWIN-64-STATIC-LABEL: foo01:
; DARWIN-64-STATIC: ## %bb.0: ## %entry
; DARWIN-64-STATIC-NEXT: movq _dst@GOTPCREL(%rip), %rax
; DARWIN-64-STATIC-NEXT: movq _ptr@GOTPCREL(%rip), %rcx
; DARWIN-64-STATIC-NEXT: movq %rax, (%rcx)
; DARWIN-64-STATIC-NEXT: retq
;
; DARWIN-64-DYNAMIC-LABEL: foo01:
; DARWIN-64-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-64-DYNAMIC-NEXT: movq _dst@GOTPCREL(%rip), %rax
; DARWIN-64-DYNAMIC-NEXT: movq _ptr@GOTPCREL(%rip), %rcx
; DARWIN-64-DYNAMIC-NEXT: movq %rax, (%rcx)
; DARWIN-64-DYNAMIC-NEXT: retq
;
; DARWIN-64-PIC-LABEL: foo01:
; DARWIN-64-PIC: ## %bb.0: ## %entry
; DARWIN-64-PIC-NEXT: movq _dst@GOTPCREL(%rip), %rax
; DARWIN-64-PIC-NEXT: movq _ptr@GOTPCREL(%rip), %rcx
; DARWIN-64-PIC-NEXT: movq %rax, (%rcx)
; DARWIN-64-PIC-NEXT: retq
entry:
store i32* getelementptr ([131072 x i32], [131072 x i32]* @dst, i32 0, i32 0), i32** @ptr, align 8
ret void
}
define void @fxo01() nounwind {
; LINUX-64-STATIC-LABEL: fxo01:
; LINUX-64-STATIC: # %bb.0: # %entry
; LINUX-64-STATIC-NEXT: movq $xdst, ptr(%rip)
; LINUX-64-STATIC-NEXT: retq
;
; LINUX-32-STATIC-LABEL: fxo01:
; LINUX-32-STATIC: # %bb.0: # %entry
; LINUX-32-STATIC-NEXT: movl $xdst, ptr
; LINUX-32-STATIC-NEXT: retl
;
; LINUX-32-PIC-LABEL: fxo01:
; LINUX-32-PIC: # %bb.0: # %entry
; LINUX-32-PIC-NEXT: movl $xdst, ptr
; LINUX-32-PIC-NEXT: retl
;
; LINUX-64-PIC-LABEL: fxo01:
; LINUX-64-PIC: # %bb.0: # %entry
; LINUX-64-PIC-NEXT: movq xdst@GOTPCREL(%rip), %rax
; LINUX-64-PIC-NEXT: movq ptr@GOTPCREL(%rip), %rcx
; LINUX-64-PIC-NEXT: movq %rax, (%rcx)
; LINUX-64-PIC-NEXT: retq
;
; DARWIN-32-STATIC-LABEL: fxo01:
; DARWIN-32-STATIC: ## %bb.0: ## %entry
; DARWIN-32-STATIC-NEXT: movl $_xdst, _ptr
; DARWIN-32-STATIC-NEXT: retl
;
; DARWIN-32-DYNAMIC-LABEL: fxo01:
; DARWIN-32-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-32-DYNAMIC-NEXT: movl L_xdst$non_lazy_ptr, %eax
; DARWIN-32-DYNAMIC-NEXT: movl L_ptr$non_lazy_ptr, %ecx
; DARWIN-32-DYNAMIC-NEXT: movl %eax, (%ecx)
; DARWIN-32-DYNAMIC-NEXT: retl
;
; DARWIN-32-PIC-LABEL: fxo01:
; DARWIN-32-PIC: ## %bb.0: ## %entry
; DARWIN-32-PIC-NEXT: calll L3$pb
; DARWIN-32-PIC-NEXT: L3$pb:
; DARWIN-32-PIC-NEXT: popl %eax
; DARWIN-32-PIC-NEXT: movl L_xdst$non_lazy_ptr-L3$pb(%eax), %ecx
; DARWIN-32-PIC-NEXT: movl L_ptr$non_lazy_ptr-L3$pb(%eax), %eax
; DARWIN-32-PIC-NEXT: movl %ecx, (%eax)
; DARWIN-32-PIC-NEXT: retl
;
; DARWIN-64-STATIC-LABEL: fxo01:
; DARWIN-64-STATIC: ## %bb.0: ## %entry
; DARWIN-64-STATIC-NEXT: movq _xdst@GOTPCREL(%rip), %rax
; DARWIN-64-STATIC-NEXT: movq _ptr@GOTPCREL(%rip), %rcx
; DARWIN-64-STATIC-NEXT: movq %rax, (%rcx)
; DARWIN-64-STATIC-NEXT: retq
;
; DARWIN-64-DYNAMIC-LABEL: fxo01:
; DARWIN-64-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-64-DYNAMIC-NEXT: movq _xdst@GOTPCREL(%rip), %rax
; DARWIN-64-DYNAMIC-NEXT: movq _ptr@GOTPCREL(%rip), %rcx
; DARWIN-64-DYNAMIC-NEXT: movq %rax, (%rcx)
; DARWIN-64-DYNAMIC-NEXT: retq
;
; DARWIN-64-PIC-LABEL: fxo01:
; DARWIN-64-PIC: ## %bb.0: ## %entry
; DARWIN-64-PIC-NEXT: movq _xdst@GOTPCREL(%rip), %rax
; DARWIN-64-PIC-NEXT: movq _ptr@GOTPCREL(%rip), %rcx
; DARWIN-64-PIC-NEXT: movq %rax, (%rcx)
; DARWIN-64-PIC-NEXT: retq
entry:
store i32* getelementptr ([32 x i32], [32 x i32]* @xdst, i32 0, i32 0), i32** @ptr, align 8
ret void
}
define void @foo02() nounwind {
; LINUX-64-STATIC-LABEL: foo02:
; LINUX-64-STATIC: # %bb.0: # %entry
; LINUX-64-STATIC-NEXT: movl src(%rip), %eax
; LINUX-64-STATIC-NEXT: movq ptr(%rip), %rcx
; LINUX-64-STATIC-NEXT: movl %eax, (%rcx)
; LINUX-64-STATIC-NEXT: retq
;
; LINUX-32-STATIC-LABEL: foo02:
; LINUX-32-STATIC: # %bb.0: # %entry
; LINUX-32-STATIC-NEXT: movl src, %eax
; LINUX-32-STATIC-NEXT: movl ptr, %ecx
; LINUX-32-STATIC-NEXT: movl %eax, (%ecx)
; LINUX-32-STATIC-NEXT: retl
;
; LINUX-32-PIC-LABEL: foo02:
; LINUX-32-PIC: # %bb.0: # %entry
; LINUX-32-PIC-NEXT: movl src, %eax
; LINUX-32-PIC-NEXT: movl ptr, %ecx
; LINUX-32-PIC-NEXT: movl %eax, (%ecx)
; LINUX-32-PIC-NEXT: retl
;
; LINUX-64-PIC-LABEL: foo02:
; LINUX-64-PIC: # %bb.0: # %entry
; LINUX-64-PIC-NEXT: movq src@GOTPCREL(%rip), %rax
; LINUX-64-PIC-NEXT: movl (%rax), %eax
; LINUX-64-PIC-NEXT: movq ptr@GOTPCREL(%rip), %rcx
; LINUX-64-PIC-NEXT: movq (%rcx), %rcx
; LINUX-64-PIC-NEXT: movl %eax, (%rcx)
; LINUX-64-PIC-NEXT: retq
;
; DARWIN-32-STATIC-LABEL: foo02:
; DARWIN-32-STATIC: ## %bb.0: ## %entry
; DARWIN-32-STATIC-NEXT: movl _src, %eax
; DARWIN-32-STATIC-NEXT: movl _ptr, %ecx
; DARWIN-32-STATIC-NEXT: movl %eax, (%ecx)
; DARWIN-32-STATIC-NEXT: retl
;
; DARWIN-32-DYNAMIC-LABEL: foo02:
; DARWIN-32-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-32-DYNAMIC-NEXT: movl L_src$non_lazy_ptr, %eax
; DARWIN-32-DYNAMIC-NEXT: movl (%eax), %eax
; DARWIN-32-DYNAMIC-NEXT: movl L_ptr$non_lazy_ptr, %ecx
; DARWIN-32-DYNAMIC-NEXT: movl (%ecx), %ecx
; DARWIN-32-DYNAMIC-NEXT: movl %eax, (%ecx)
; DARWIN-32-DYNAMIC-NEXT: retl
;
; DARWIN-32-PIC-LABEL: foo02:
; DARWIN-32-PIC: ## %bb.0: ## %entry
; DARWIN-32-PIC-NEXT: calll L4$pb
; DARWIN-32-PIC-NEXT: L4$pb:
; DARWIN-32-PIC-NEXT: popl %eax
; DARWIN-32-PIC-NEXT: movl L_src$non_lazy_ptr-L4$pb(%eax), %ecx
; DARWIN-32-PIC-NEXT: movl (%ecx), %ecx
; DARWIN-32-PIC-NEXT: movl L_ptr$non_lazy_ptr-L4$pb(%eax), %eax
; DARWIN-32-PIC-NEXT: movl (%eax), %eax
; DARWIN-32-PIC-NEXT: movl %ecx, (%eax)
; DARWIN-32-PIC-NEXT: retl
;
; DARWIN-64-STATIC-LABEL: foo02:
; DARWIN-64-STATIC: ## %bb.0: ## %entry
; DARWIN-64-STATIC-NEXT: movq _src@GOTPCREL(%rip), %rax
; DARWIN-64-STATIC-NEXT: movl (%rax), %eax
; DARWIN-64-STATIC-NEXT: movq _ptr@GOTPCREL(%rip), %rcx
; DARWIN-64-STATIC-NEXT: movq (%rcx), %rcx
; DARWIN-64-STATIC-NEXT: movl %eax, (%rcx)
; DARWIN-64-STATIC-NEXT: retq
;
; DARWIN-64-DYNAMIC-LABEL: foo02:
; DARWIN-64-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-64-DYNAMIC-NEXT: movq _src@GOTPCREL(%rip), %rax
; DARWIN-64-DYNAMIC-NEXT: movl (%rax), %eax
; DARWIN-64-DYNAMIC-NEXT: movq _ptr@GOTPCREL(%rip), %rcx
; DARWIN-64-DYNAMIC-NEXT: movq (%rcx), %rcx
; DARWIN-64-DYNAMIC-NEXT: movl %eax, (%rcx)
; DARWIN-64-DYNAMIC-NEXT: retq
;
; DARWIN-64-PIC-LABEL: foo02:
; DARWIN-64-PIC: ## %bb.0: ## %entry
; DARWIN-64-PIC-NEXT: movq _src@GOTPCREL(%rip), %rax
; DARWIN-64-PIC-NEXT: movl (%rax), %eax
; DARWIN-64-PIC-NEXT: movq _ptr@GOTPCREL(%rip), %rcx
; DARWIN-64-PIC-NEXT: movq (%rcx), %rcx
; DARWIN-64-PIC-NEXT: movl %eax, (%rcx)
; DARWIN-64-PIC-NEXT: retq
entry:
%0 = load i32*, i32** @ptr, align 8
%1 = load i32, i32* getelementptr ([131072 x i32], [131072 x i32]* @src, i32 0, i64 0), align 4
store i32 %1, i32* %0, align 4
ret void
}
define void @fxo02() nounwind {
; LINUX-64-STATIC-LABEL: fxo02:
; LINUX-64-STATIC: # %bb.0: # %entry
; LINUX-64-STATIC-NEXT: movl xsrc(%rip), %eax
; LINUX-64-STATIC-NEXT: movq ptr(%rip), %rcx
; LINUX-64-STATIC-NEXT: movl %eax, (%rcx)
; LINUX-64-STATIC-NEXT: retq
;
; LINUX-32-STATIC-LABEL: fxo02:
; LINUX-32-STATIC: # %bb.0: # %entry
; LINUX-32-STATIC-NEXT: movl xsrc, %eax
; LINUX-32-STATIC-NEXT: movl ptr, %ecx
; LINUX-32-STATIC-NEXT: movl %eax, (%ecx)
; LINUX-32-STATIC-NEXT: retl
;
; LINUX-32-PIC-LABEL: fxo02:
; LINUX-32-PIC: # %bb.0: # %entry
; LINUX-32-PIC-NEXT: movl xsrc, %eax
; LINUX-32-PIC-NEXT: movl ptr, %ecx
; LINUX-32-PIC-NEXT: movl %eax, (%ecx)
; LINUX-32-PIC-NEXT: retl
;
; LINUX-64-PIC-LABEL: fxo02:
; LINUX-64-PIC: # %bb.0: # %entry
; LINUX-64-PIC-NEXT: movq xsrc@GOTPCREL(%rip), %rax
; LINUX-64-PIC-NEXT: movl (%rax), %eax
; LINUX-64-PIC-NEXT: movq ptr@GOTPCREL(%rip), %rcx
; LINUX-64-PIC-NEXT: movq (%rcx), %rcx
; LINUX-64-PIC-NEXT: movl %eax, (%rcx)
; LINUX-64-PIC-NEXT: retq
;
; DARWIN-32-STATIC-LABEL: fxo02:
; DARWIN-32-STATIC: ## %bb.0: ## %entry
; DARWIN-32-STATIC-NEXT: movl _xsrc, %eax
; DARWIN-32-STATIC-NEXT: movl _ptr, %ecx
; DARWIN-32-STATIC-NEXT: movl %eax, (%ecx)
; DARWIN-32-STATIC-NEXT: retl
;
; DARWIN-32-DYNAMIC-LABEL: fxo02:
; DARWIN-32-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-32-DYNAMIC-NEXT: movl L_xsrc$non_lazy_ptr, %eax
; DARWIN-32-DYNAMIC-NEXT: movl (%eax), %eax
; DARWIN-32-DYNAMIC-NEXT: movl L_ptr$non_lazy_ptr, %ecx
; DARWIN-32-DYNAMIC-NEXT: movl (%ecx), %ecx
; DARWIN-32-DYNAMIC-NEXT: movl %eax, (%ecx)
; DARWIN-32-DYNAMIC-NEXT: retl
;
; DARWIN-32-PIC-LABEL: fxo02:
; DARWIN-32-PIC: ## %bb.0: ## %entry
; DARWIN-32-PIC-NEXT: calll L5$pb
; DARWIN-32-PIC-NEXT: L5$pb:
; DARWIN-32-PIC-NEXT: popl %eax
; DARWIN-32-PIC-NEXT: movl L_xsrc$non_lazy_ptr-L5$pb(%eax), %ecx
; DARWIN-32-PIC-NEXT: movl (%ecx), %ecx
; DARWIN-32-PIC-NEXT: movl L_ptr$non_lazy_ptr-L5$pb(%eax), %eax
; DARWIN-32-PIC-NEXT: movl (%eax), %eax
; DARWIN-32-PIC-NEXT: movl %ecx, (%eax)
; DARWIN-32-PIC-NEXT: retl
;
; DARWIN-64-STATIC-LABEL: fxo02:
; DARWIN-64-STATIC: ## %bb.0: ## %entry
; DARWIN-64-STATIC-NEXT: movq _xsrc@GOTPCREL(%rip), %rax
; DARWIN-64-STATIC-NEXT: movl (%rax), %eax
; DARWIN-64-STATIC-NEXT: movq _ptr@GOTPCREL(%rip), %rcx
; DARWIN-64-STATIC-NEXT: movq (%rcx), %rcx
; DARWIN-64-STATIC-NEXT: movl %eax, (%rcx)
; DARWIN-64-STATIC-NEXT: retq
;
; DARWIN-64-DYNAMIC-LABEL: fxo02:
; DARWIN-64-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-64-DYNAMIC-NEXT: movq _xsrc@GOTPCREL(%rip), %rax
; DARWIN-64-DYNAMIC-NEXT: movl (%rax), %eax
; DARWIN-64-DYNAMIC-NEXT: movq _ptr@GOTPCREL(%rip), %rcx
; DARWIN-64-DYNAMIC-NEXT: movq (%rcx), %rcx
; DARWIN-64-DYNAMIC-NEXT: movl %eax, (%rcx)
; DARWIN-64-DYNAMIC-NEXT: retq
;
; DARWIN-64-PIC-LABEL: fxo02:
; DARWIN-64-PIC: ## %bb.0: ## %entry
; DARWIN-64-PIC-NEXT: movq _xsrc@GOTPCREL(%rip), %rax
; DARWIN-64-PIC-NEXT: movl (%rax), %eax
; DARWIN-64-PIC-NEXT: movq _ptr@GOTPCREL(%rip), %rcx
; DARWIN-64-PIC-NEXT: movq (%rcx), %rcx
; DARWIN-64-PIC-NEXT: movl %eax, (%rcx)
; DARWIN-64-PIC-NEXT: retq
entry:
%0 = load i32*, i32** @ptr, align 8
%1 = load i32, i32* getelementptr ([32 x i32], [32 x i32]* @xsrc, i32 0, i64 0), align 4
store i32 %1, i32* %0, align 4
ret void
}
define void @foo03() nounwind {
; LINUX-64-STATIC-LABEL: foo03:
; LINUX-64-STATIC: # %bb.0: # %entry
; LINUX-64-STATIC-NEXT: movl dsrc(%rip), %eax
; LINUX-64-STATIC-NEXT: movl %eax, ddst(%rip)
; LINUX-64-STATIC-NEXT: retq
;
; LINUX-32-STATIC-LABEL: foo03:
; LINUX-32-STATIC: # %bb.0: # %entry
; LINUX-32-STATIC-NEXT: movl dsrc, %eax
; LINUX-32-STATIC-NEXT: movl %eax, ddst
; LINUX-32-STATIC-NEXT: retl
;
; LINUX-32-PIC-LABEL: foo03:
; LINUX-32-PIC: # %bb.0: # %entry
; LINUX-32-PIC-NEXT: movl dsrc, %eax
; LINUX-32-PIC-NEXT: movl %eax, ddst
; LINUX-32-PIC-NEXT: retl
;
; LINUX-64-PIC-LABEL: foo03:
; LINUX-64-PIC: # %bb.0: # %entry
; LINUX-64-PIC-NEXT: movq dsrc@GOTPCREL(%rip), %rax
; LINUX-64-PIC-NEXT: movl (%rax), %eax
; LINUX-64-PIC-NEXT: movq ddst@GOTPCREL(%rip), %rcx
; LINUX-64-PIC-NEXT: movl %eax, (%rcx)
; LINUX-64-PIC-NEXT: retq
;
; DARWIN-32-STATIC-LABEL: foo03:
; DARWIN-32-STATIC: ## %bb.0: ## %entry
; DARWIN-32-STATIC-NEXT: movl _dsrc, %eax
; DARWIN-32-STATIC-NEXT: movl %eax, _ddst
; DARWIN-32-STATIC-NEXT: retl
;
; DARWIN-32-DYNAMIC-LABEL: foo03:
; DARWIN-32-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-32-DYNAMIC-NEXT: movl _dsrc, %eax
; DARWIN-32-DYNAMIC-NEXT: movl %eax, _ddst
; DARWIN-32-DYNAMIC-NEXT: retl
;
; DARWIN-32-PIC-LABEL: foo03:
; DARWIN-32-PIC: ## %bb.0: ## %entry
; DARWIN-32-PIC-NEXT: calll L6$pb
; DARWIN-32-PIC-NEXT: L6$pb:
; DARWIN-32-PIC-NEXT: popl %eax
; DARWIN-32-PIC-NEXT: movl _dsrc-L6$pb(%eax), %ecx
; DARWIN-32-PIC-NEXT: movl %ecx, _ddst-L6$pb(%eax)
; DARWIN-32-PIC-NEXT: retl
;
; DARWIN-64-STATIC-LABEL: foo03:
; DARWIN-64-STATIC: ## %bb.0: ## %entry
; DARWIN-64-STATIC-NEXT: movl _dsrc(%rip), %eax
; DARWIN-64-STATIC-NEXT: movl %eax, _ddst(%rip)
; DARWIN-64-STATIC-NEXT: retq
;
; DARWIN-64-DYNAMIC-LABEL: foo03:
; DARWIN-64-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-64-DYNAMIC-NEXT: movl _dsrc(%rip), %eax
; DARWIN-64-DYNAMIC-NEXT: movl %eax, _ddst(%rip)
; DARWIN-64-DYNAMIC-NEXT: retq
;
; DARWIN-64-PIC-LABEL: foo03:
; DARWIN-64-PIC: ## %bb.0: ## %entry
; DARWIN-64-PIC-NEXT: movl _dsrc(%rip), %eax
; DARWIN-64-PIC-NEXT: movl %eax, _ddst(%rip)
; DARWIN-64-PIC-NEXT: retq
entry:
%0 = load i32, i32* getelementptr ([131072 x i32], [131072 x i32]* @dsrc, i32 0, i64 0), align 32
store i32 %0, i32* getelementptr ([131072 x i32], [131072 x i32]* @ddst, i32 0, i64 0), align 32
ret void
}
define void @foo04() nounwind {
; LINUX-64-STATIC-LABEL: foo04:
; LINUX-64-STATIC: # %bb.0: # %entry
; LINUX-64-STATIC-NEXT: movq $ddst, dptr(%rip)
; LINUX-64-STATIC-NEXT: retq
;
; LINUX-32-STATIC-LABEL: foo04:
; LINUX-32-STATIC: # %bb.0: # %entry
; LINUX-32-STATIC-NEXT: movl $ddst, dptr
; LINUX-32-STATIC-NEXT: retl
;
; LINUX-32-PIC-LABEL: foo04:
; LINUX-32-PIC: # %bb.0: # %entry
; LINUX-32-PIC-NEXT: movl $ddst, dptr
; LINUX-32-PIC-NEXT: retl
;
; LINUX-64-PIC-LABEL: foo04:
; LINUX-64-PIC: # %bb.0: # %entry
; LINUX-64-PIC-NEXT: movq ddst@GOTPCREL(%rip), %rax
; LINUX-64-PIC-NEXT: movq dptr@GOTPCREL(%rip), %rcx
; LINUX-64-PIC-NEXT: movq %rax, (%rcx)
; LINUX-64-PIC-NEXT: retq
;
; DARWIN-32-STATIC-LABEL: foo04:
; DARWIN-32-STATIC: ## %bb.0: ## %entry
; DARWIN-32-STATIC-NEXT: movl $_ddst, _dptr
; DARWIN-32-STATIC-NEXT: retl
;
; DARWIN-32-DYNAMIC-LABEL: foo04:
; DARWIN-32-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-32-DYNAMIC-NEXT: movl $_ddst, _dptr
; DARWIN-32-DYNAMIC-NEXT: retl
;
; DARWIN-32-PIC-LABEL: foo04:
; DARWIN-32-PIC: ## %bb.0: ## %entry
; DARWIN-32-PIC-NEXT: calll L7$pb
; DARWIN-32-PIC-NEXT: L7$pb:
; DARWIN-32-PIC-NEXT: popl %eax
; DARWIN-32-PIC-NEXT: leal _ddst-L7$pb(%eax), %ecx
; DARWIN-32-PIC-NEXT: movl %ecx, _dptr-L7$pb(%eax)
; DARWIN-32-PIC-NEXT: retl
;
; DARWIN-64-STATIC-LABEL: foo04:
; DARWIN-64-STATIC: ## %bb.0: ## %entry
; DARWIN-64-STATIC-NEXT: leaq _ddst(%rip), %rax
; DARWIN-64-STATIC-NEXT: movq %rax, _dptr(%rip)
; DARWIN-64-STATIC-NEXT: retq
;
; DARWIN-64-DYNAMIC-LABEL: foo04:
; DARWIN-64-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-64-DYNAMIC-NEXT: leaq _ddst(%rip), %rax
; DARWIN-64-DYNAMIC-NEXT: movq %rax, _dptr(%rip)
; DARWIN-64-DYNAMIC-NEXT: retq
;
; DARWIN-64-PIC-LABEL: foo04:
; DARWIN-64-PIC: ## %bb.0: ## %entry
; DARWIN-64-PIC-NEXT: leaq _ddst(%rip), %rax
; DARWIN-64-PIC-NEXT: movq %rax, _dptr(%rip)
; DARWIN-64-PIC-NEXT: retq
entry:
store i32* getelementptr ([131072 x i32], [131072 x i32]* @ddst, i32 0, i32 0), i32** @dptr, align 8
ret void
}
define void @foo05() nounwind {
; LINUX-64-STATIC-LABEL: foo05:
; LINUX-64-STATIC: # %bb.0: # %entry
; LINUX-64-STATIC-NEXT: movl dsrc(%rip), %eax
; LINUX-64-STATIC-NEXT: movq dptr(%rip), %rcx
; LINUX-64-STATIC-NEXT: movl %eax, (%rcx)
; LINUX-64-STATIC-NEXT: retq
;
; LINUX-32-STATIC-LABEL: foo05:
; LINUX-32-STATIC: # %bb.0: # %entry
; LINUX-32-STATIC-NEXT: movl dsrc, %eax
; LINUX-32-STATIC-NEXT: movl dptr, %ecx
; LINUX-32-STATIC-NEXT: movl %eax, (%ecx)
; LINUX-32-STATIC-NEXT: retl
;
; LINUX-32-PIC-LABEL: foo05:
; LINUX-32-PIC: # %bb.0: # %entry
; LINUX-32-PIC-NEXT: movl dsrc, %eax
; LINUX-32-PIC-NEXT: movl dptr, %ecx
; LINUX-32-PIC-NEXT: movl %eax, (%ecx)
; LINUX-32-PIC-NEXT: retl
;
; LINUX-64-PIC-LABEL: foo05:
; LINUX-64-PIC: # %bb.0: # %entry
; LINUX-64-PIC-NEXT: movq dsrc@GOTPCREL(%rip), %rax
; LINUX-64-PIC-NEXT: movl (%rax), %eax
; LINUX-64-PIC-NEXT: movq dptr@GOTPCREL(%rip), %rcx
; LINUX-64-PIC-NEXT: movq (%rcx), %rcx
; LINUX-64-PIC-NEXT: movl %eax, (%rcx)
; LINUX-64-PIC-NEXT: retq
;
; DARWIN-32-STATIC-LABEL: foo05:
; DARWIN-32-STATIC: ## %bb.0: ## %entry
; DARWIN-32-STATIC-NEXT: movl _dsrc, %eax
; DARWIN-32-STATIC-NEXT: movl _dptr, %ecx
; DARWIN-32-STATIC-NEXT: movl %eax, (%ecx)
; DARWIN-32-STATIC-NEXT: retl
;
; DARWIN-32-DYNAMIC-LABEL: foo05:
; DARWIN-32-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-32-DYNAMIC-NEXT: movl _dsrc, %eax
; DARWIN-32-DYNAMIC-NEXT: movl _dptr, %ecx
; DARWIN-32-DYNAMIC-NEXT: movl %eax, (%ecx)
; DARWIN-32-DYNAMIC-NEXT: retl
;
; DARWIN-32-PIC-LABEL: foo05:
; DARWIN-32-PIC: ## %bb.0: ## %entry
; DARWIN-32-PIC-NEXT: calll L8$pb
; DARWIN-32-PIC-NEXT: L8$pb:
; DARWIN-32-PIC-NEXT: popl %eax
; DARWIN-32-PIC-NEXT: movl _dsrc-L8$pb(%eax), %ecx
; DARWIN-32-PIC-NEXT: movl _dptr-L8$pb(%eax), %eax
; DARWIN-32-PIC-NEXT: movl %ecx, (%eax)
; DARWIN-32-PIC-NEXT: retl
;
; DARWIN-64-STATIC-LABEL: foo05:
; DARWIN-64-STATIC: ## %bb.0: ## %entry
; DARWIN-64-STATIC-NEXT: movl _dsrc(%rip), %eax
; DARWIN-64-STATIC-NEXT: movq _dptr(%rip), %rcx
; DARWIN-64-STATIC-NEXT: movl %eax, (%rcx)
; DARWIN-64-STATIC-NEXT: retq
;
; DARWIN-64-DYNAMIC-LABEL: foo05:
; DARWIN-64-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-64-DYNAMIC-NEXT: movl _dsrc(%rip), %eax
; DARWIN-64-DYNAMIC-NEXT: movq _dptr(%rip), %rcx
; DARWIN-64-DYNAMIC-NEXT: movl %eax, (%rcx)
; DARWIN-64-DYNAMIC-NEXT: retq
;
; DARWIN-64-PIC-LABEL: foo05:
; DARWIN-64-PIC: ## %bb.0: ## %entry
; DARWIN-64-PIC-NEXT: movl _dsrc(%rip), %eax
; DARWIN-64-PIC-NEXT: movq _dptr(%rip), %rcx
; DARWIN-64-PIC-NEXT: movl %eax, (%rcx)
; DARWIN-64-PIC-NEXT: retq
entry:
%0 = load i32*, i32** @dptr, align 8
%1 = load i32, i32* getelementptr ([131072 x i32], [131072 x i32]* @dsrc, i32 0, i64 0), align 32
store i32 %1, i32* %0, align 4
ret void
}
define void @foo06() nounwind {
; LINUX-64-STATIC-LABEL: foo06:
; LINUX-64-STATIC: # %bb.0: # %entry
; LINUX-64-STATIC-NEXT: movl lsrc(%rip), %eax
; LINUX-64-STATIC-NEXT: movl %eax, ldst(%rip)
; LINUX-64-STATIC-NEXT: retq
;
; LINUX-32-STATIC-LABEL: foo06:
; LINUX-32-STATIC: # %bb.0: # %entry
; LINUX-32-STATIC-NEXT: movl lsrc, %eax
; LINUX-32-STATIC-NEXT: movl %eax, ldst
; LINUX-32-STATIC-NEXT: retl
;
; LINUX-32-PIC-LABEL: foo06:
; LINUX-32-PIC: # %bb.0: # %entry
; LINUX-32-PIC-NEXT: movl lsrc, %eax
; LINUX-32-PIC-NEXT: movl %eax, ldst
; LINUX-32-PIC-NEXT: retl
;
; LINUX-64-PIC-LABEL: foo06:
; LINUX-64-PIC: # %bb.0: # %entry
; LINUX-64-PIC-NEXT: movl lsrc(%rip), %eax
; LINUX-64-PIC-NEXT: movl %eax, ldst(%rip)
; LINUX-64-PIC-NEXT: retq
;
; DARWIN-32-STATIC-LABEL: foo06:
; DARWIN-32-STATIC: ## %bb.0: ## %entry
; DARWIN-32-STATIC-NEXT: movl _lsrc, %eax
; DARWIN-32-STATIC-NEXT: movl %eax, _ldst
; DARWIN-32-STATIC-NEXT: retl
;
; DARWIN-32-DYNAMIC-LABEL: foo06:
; DARWIN-32-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-32-DYNAMIC-NEXT: movl _lsrc, %eax
; DARWIN-32-DYNAMIC-NEXT: movl %eax, _ldst
; DARWIN-32-DYNAMIC-NEXT: retl
;
; DARWIN-32-PIC-LABEL: foo06:
; DARWIN-32-PIC: ## %bb.0: ## %entry
; DARWIN-32-PIC-NEXT: calll L9$pb
; DARWIN-32-PIC-NEXT: L9$pb:
; DARWIN-32-PIC-NEXT: popl %eax
; DARWIN-32-PIC-NEXT: movl _lsrc-L9$pb(%eax), %ecx
; DARWIN-32-PIC-NEXT: movl %ecx, _ldst-L9$pb(%eax)
; DARWIN-32-PIC-NEXT: retl
;
; DARWIN-64-STATIC-LABEL: foo06:
; DARWIN-64-STATIC: ## %bb.0: ## %entry
; DARWIN-64-STATIC-NEXT: movl _lsrc(%rip), %eax
; DARWIN-64-STATIC-NEXT: movl %eax, _ldst(%rip)
; DARWIN-64-STATIC-NEXT: retq
;
; DARWIN-64-DYNAMIC-LABEL: foo06:
; DARWIN-64-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-64-DYNAMIC-NEXT: movl _lsrc(%rip), %eax
; DARWIN-64-DYNAMIC-NEXT: movl %eax, _ldst(%rip)
; DARWIN-64-DYNAMIC-NEXT: retq
;
; DARWIN-64-PIC-LABEL: foo06:
; DARWIN-64-PIC: ## %bb.0: ## %entry
; DARWIN-64-PIC-NEXT: movl _lsrc(%rip), %eax
; DARWIN-64-PIC-NEXT: movl %eax, _ldst(%rip)
; DARWIN-64-PIC-NEXT: retq
entry:
%0 = load i32, i32* getelementptr ([131072 x i32], [131072 x i32]* @lsrc, i32 0, i64 0), align 4
store i32 %0, i32* getelementptr ([131072 x i32], [131072 x i32]* @ldst, i32 0, i64 0), align 4
ret void
}
define void @foo07() nounwind {
; LINUX-64-STATIC-LABEL: foo07:
; LINUX-64-STATIC: # %bb.0: # %entry
; LINUX-64-STATIC-NEXT: movq $ldst, lptr(%rip)
; LINUX-64-STATIC-NEXT: retq
;
; LINUX-32-STATIC-LABEL: foo07:
; LINUX-32-STATIC: # %bb.0: # %entry
; LINUX-32-STATIC-NEXT: movl $ldst, lptr
; LINUX-32-STATIC-NEXT: retl
;
; LINUX-32-PIC-LABEL: foo07:
; LINUX-32-PIC: # %bb.0: # %entry
; LINUX-32-PIC-NEXT: movl $ldst, lptr
; LINUX-32-PIC-NEXT: retl
;
; LINUX-64-PIC-LABEL: foo07:
; LINUX-64-PIC: # %bb.0: # %entry
; LINUX-64-PIC-NEXT: leaq ldst(%rip), %rax
; LINUX-64-PIC-NEXT: movq %rax, lptr(%rip)
; LINUX-64-PIC-NEXT: retq
;
; DARWIN-32-STATIC-LABEL: foo07:
; DARWIN-32-STATIC: ## %bb.0: ## %entry
; DARWIN-32-STATIC-NEXT: movl $_ldst, _lptr
; DARWIN-32-STATIC-NEXT: retl
;
; DARWIN-32-DYNAMIC-LABEL: foo07:
; DARWIN-32-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-32-DYNAMIC-NEXT: movl $_ldst, _lptr
; DARWIN-32-DYNAMIC-NEXT: retl
;
; DARWIN-32-PIC-LABEL: foo07:
; DARWIN-32-PIC: ## %bb.0: ## %entry
; DARWIN-32-PIC-NEXT: calll L10$pb
; DARWIN-32-PIC-NEXT: L10$pb:
; DARWIN-32-PIC-NEXT: popl %eax
; DARWIN-32-PIC-NEXT: leal _ldst-L10$pb(%eax), %ecx
; DARWIN-32-PIC-NEXT: movl %ecx, _lptr-L10$pb(%eax)
; DARWIN-32-PIC-NEXT: retl
;
; DARWIN-64-STATIC-LABEL: foo07:
; DARWIN-64-STATIC: ## %bb.0: ## %entry
; DARWIN-64-STATIC-NEXT: leaq _ldst(%rip), %rax
; DARWIN-64-STATIC-NEXT: movq %rax, _lptr(%rip)
; DARWIN-64-STATIC-NEXT: retq
;
; DARWIN-64-DYNAMIC-LABEL: foo07:
; DARWIN-64-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-64-DYNAMIC-NEXT: leaq _ldst(%rip), %rax
; DARWIN-64-DYNAMIC-NEXT: movq %rax, _lptr(%rip)
; DARWIN-64-DYNAMIC-NEXT: retq
;
; DARWIN-64-PIC-LABEL: foo07:
; DARWIN-64-PIC: ## %bb.0: ## %entry
; DARWIN-64-PIC-NEXT: leaq _ldst(%rip), %rax
; DARWIN-64-PIC-NEXT: movq %rax, _lptr(%rip)
; DARWIN-64-PIC-NEXT: retq
entry:
store i32* getelementptr ([131072 x i32], [131072 x i32]* @ldst, i32 0, i32 0), i32** @lptr, align 8
ret void
}
define void @foo08() nounwind {
; LINUX-64-STATIC-LABEL: foo08:
; LINUX-64-STATIC: # %bb.0: # %entry
; LINUX-64-STATIC-NEXT: movl lsrc(%rip), %eax
; LINUX-64-STATIC-NEXT: movq lptr(%rip), %rcx
; LINUX-64-STATIC-NEXT: movl %eax, (%rcx)
; LINUX-64-STATIC-NEXT: retq
;
; LINUX-32-STATIC-LABEL: foo08:
; LINUX-32-STATIC: # %bb.0: # %entry
; LINUX-32-STATIC-NEXT: movl lsrc, %eax
; LINUX-32-STATIC-NEXT: movl lptr, %ecx
; LINUX-32-STATIC-NEXT: movl %eax, (%ecx)
; LINUX-32-STATIC-NEXT: retl
;
; LINUX-32-PIC-LABEL: foo08:
; LINUX-32-PIC: # %bb.0: # %entry
; LINUX-32-PIC-NEXT: movl lsrc, %eax
; LINUX-32-PIC-NEXT: movl lptr, %ecx
; LINUX-32-PIC-NEXT: movl %eax, (%ecx)
; LINUX-32-PIC-NEXT: retl
;
; LINUX-64-PIC-LABEL: foo08:
; LINUX-64-PIC: # %bb.0: # %entry
; LINUX-64-PIC-NEXT: movl lsrc(%rip), %eax
; LINUX-64-PIC-NEXT: movq lptr(%rip), %rcx
; LINUX-64-PIC-NEXT: movl %eax, (%rcx)
; LINUX-64-PIC-NEXT: retq
;
; DARWIN-32-STATIC-LABEL: foo08:
; DARWIN-32-STATIC: ## %bb.0: ## %entry
; DARWIN-32-STATIC-NEXT: movl _lsrc, %eax
; DARWIN-32-STATIC-NEXT: movl _lptr, %ecx
; DARWIN-32-STATIC-NEXT: movl %eax, (%ecx)
; DARWIN-32-STATIC-NEXT: retl
;
; DARWIN-32-DYNAMIC-LABEL: foo08:
; DARWIN-32-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-32-DYNAMIC-NEXT: movl _lsrc, %eax
; DARWIN-32-DYNAMIC-NEXT: movl _lptr, %ecx
; DARWIN-32-DYNAMIC-NEXT: movl %eax, (%ecx)
; DARWIN-32-DYNAMIC-NEXT: retl
;
; DARWIN-32-PIC-LABEL: foo08:
; DARWIN-32-PIC: ## %bb.0: ## %entry
; DARWIN-32-PIC-NEXT: calll L11$pb
; DARWIN-32-PIC-NEXT: L11$pb:
; DARWIN-32-PIC-NEXT: popl %eax
; DARWIN-32-PIC-NEXT: movl _lsrc-L11$pb(%eax), %ecx
; DARWIN-32-PIC-NEXT: movl _lptr-L11$pb(%eax), %eax
; DARWIN-32-PIC-NEXT: movl %ecx, (%eax)
; DARWIN-32-PIC-NEXT: retl
;
; DARWIN-64-STATIC-LABEL: foo08:
; DARWIN-64-STATIC: ## %bb.0: ## %entry
; DARWIN-64-STATIC-NEXT: movl _lsrc(%rip), %eax
; DARWIN-64-STATIC-NEXT: movq _lptr(%rip), %rcx
; DARWIN-64-STATIC-NEXT: movl %eax, (%rcx)
; DARWIN-64-STATIC-NEXT: retq
;
; DARWIN-64-DYNAMIC-LABEL: foo08:
; DARWIN-64-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-64-DYNAMIC-NEXT: movl _lsrc(%rip), %eax
; DARWIN-64-DYNAMIC-NEXT: movq _lptr(%rip), %rcx
; DARWIN-64-DYNAMIC-NEXT: movl %eax, (%rcx)
; DARWIN-64-DYNAMIC-NEXT: retq
;
; DARWIN-64-PIC-LABEL: foo08:
; DARWIN-64-PIC: ## %bb.0: ## %entry
; DARWIN-64-PIC-NEXT: movl _lsrc(%rip), %eax
; DARWIN-64-PIC-NEXT: movq _lptr(%rip), %rcx
; DARWIN-64-PIC-NEXT: movl %eax, (%rcx)
; DARWIN-64-PIC-NEXT: retq
entry:
%0 = load i32*, i32** @lptr, align 8
%1 = load i32, i32* getelementptr ([131072 x i32], [131072 x i32]* @lsrc, i32 0, i64 0), align 4
store i32 %1, i32* %0, align 4
ret void
}
define void @qux00() nounwind {
; LINUX-64-STATIC-LABEL: qux00:
; LINUX-64-STATIC: # %bb.0: # %entry
; LINUX-64-STATIC-NEXT: movl src+64(%rip), %eax
; LINUX-64-STATIC-NEXT: movl %eax, dst+64(%rip)
; LINUX-64-STATIC-NEXT: retq
;
; LINUX-32-STATIC-LABEL: qux00:
; LINUX-32-STATIC: # %bb.0: # %entry
; LINUX-32-STATIC-NEXT: movl src+64, %eax
; LINUX-32-STATIC-NEXT: movl %eax, dst+64
; LINUX-32-STATIC-NEXT: retl
;
; LINUX-32-PIC-LABEL: qux00:
; LINUX-32-PIC: # %bb.0: # %entry
; LINUX-32-PIC-NEXT: movl src+64, %eax
; LINUX-32-PIC-NEXT: movl %eax, dst+64
; LINUX-32-PIC-NEXT: retl
;
; LINUX-64-PIC-LABEL: qux00:
; LINUX-64-PIC: # %bb.0: # %entry
; LINUX-64-PIC-NEXT: movq src@GOTPCREL(%rip), %rax
; LINUX-64-PIC-NEXT: movl 64(%rax), %eax
; LINUX-64-PIC-NEXT: movq dst@GOTPCREL(%rip), %rcx
; LINUX-64-PIC-NEXT: movl %eax, 64(%rcx)
; LINUX-64-PIC-NEXT: retq
;
; DARWIN-32-STATIC-LABEL: qux00:
; DARWIN-32-STATIC: ## %bb.0: ## %entry
; DARWIN-32-STATIC-NEXT: movl _src+64, %eax
; DARWIN-32-STATIC-NEXT: movl %eax, _dst+64
; DARWIN-32-STATIC-NEXT: retl
;
; DARWIN-32-DYNAMIC-LABEL: qux00:
; DARWIN-32-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-32-DYNAMIC-NEXT: movl L_src$non_lazy_ptr, %eax
; DARWIN-32-DYNAMIC-NEXT: movl 64(%eax), %eax
; DARWIN-32-DYNAMIC-NEXT: movl L_dst$non_lazy_ptr, %ecx
; DARWIN-32-DYNAMIC-NEXT: movl %eax, 64(%ecx)
; DARWIN-32-DYNAMIC-NEXT: retl
;
; DARWIN-32-PIC-LABEL: qux00:
; DARWIN-32-PIC: ## %bb.0: ## %entry
; DARWIN-32-PIC-NEXT: calll L12$pb
; DARWIN-32-PIC-NEXT: L12$pb:
; DARWIN-32-PIC-NEXT: popl %eax
; DARWIN-32-PIC-NEXT: movl L_src$non_lazy_ptr-L12$pb(%eax), %ecx
; DARWIN-32-PIC-NEXT: movl 64(%ecx), %ecx
; DARWIN-32-PIC-NEXT: movl L_dst$non_lazy_ptr-L12$pb(%eax), %eax
; DARWIN-32-PIC-NEXT: movl %ecx, 64(%eax)
; DARWIN-32-PIC-NEXT: retl
;
; DARWIN-64-STATIC-LABEL: qux00:
; DARWIN-64-STATIC: ## %bb.0: ## %entry
; DARWIN-64-STATIC-NEXT: movq _src@GOTPCREL(%rip), %rax
; DARWIN-64-STATIC-NEXT: movl 64(%rax), %eax
; DARWIN-64-STATIC-NEXT: movq _dst@GOTPCREL(%rip), %rcx
; DARWIN-64-STATIC-NEXT: movl %eax, 64(%rcx)
; DARWIN-64-STATIC-NEXT: retq
;
; DARWIN-64-DYNAMIC-LABEL: qux00:
; DARWIN-64-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-64-DYNAMIC-NEXT: movq _src@GOTPCREL(%rip), %rax
; DARWIN-64-DYNAMIC-NEXT: movl 64(%rax), %eax
; DARWIN-64-DYNAMIC-NEXT: movq _dst@GOTPCREL(%rip), %rcx
; DARWIN-64-DYNAMIC-NEXT: movl %eax, 64(%rcx)
; DARWIN-64-DYNAMIC-NEXT: retq
;
; DARWIN-64-PIC-LABEL: qux00:
; DARWIN-64-PIC: ## %bb.0: ## %entry
; DARWIN-64-PIC-NEXT: movq _src@GOTPCREL(%rip), %rax
; DARWIN-64-PIC-NEXT: movl 64(%rax), %eax
; DARWIN-64-PIC-NEXT: movq _dst@GOTPCREL(%rip), %rcx
; DARWIN-64-PIC-NEXT: movl %eax, 64(%rcx)
; DARWIN-64-PIC-NEXT: retq
entry:
%0 = load i32, i32* getelementptr ([131072 x i32], [131072 x i32]* @src, i32 0, i64 16), align 4
store i32 %0, i32* getelementptr ([131072 x i32], [131072 x i32]* @dst, i32 0, i64 16), align 4
ret void
}
define void @qxx00() nounwind {
; LINUX-64-STATIC-LABEL: qxx00:
; LINUX-64-STATIC: # %bb.0: # %entry
; LINUX-64-STATIC-NEXT: movl xsrc+64(%rip), %eax
; LINUX-64-STATIC-NEXT: movl %eax, xdst+64(%rip)
; LINUX-64-STATIC-NEXT: retq
;
; LINUX-32-STATIC-LABEL: qxx00:
; LINUX-32-STATIC: # %bb.0: # %entry
; LINUX-32-STATIC-NEXT: movl xsrc+64, %eax
; LINUX-32-STATIC-NEXT: movl %eax, xdst+64
; LINUX-32-STATIC-NEXT: retl
;
; LINUX-32-PIC-LABEL: qxx00:
; LINUX-32-PIC: # %bb.0: # %entry
; LINUX-32-PIC-NEXT: movl xsrc+64, %eax
; LINUX-32-PIC-NEXT: movl %eax, xdst+64
; LINUX-32-PIC-NEXT: retl
;
; LINUX-64-PIC-LABEL: qxx00:
; LINUX-64-PIC: # %bb.0: # %entry
; LINUX-64-PIC-NEXT: movq xsrc@GOTPCREL(%rip), %rax
; LINUX-64-PIC-NEXT: movl 64(%rax), %eax
; LINUX-64-PIC-NEXT: movq xdst@GOTPCREL(%rip), %rcx
; LINUX-64-PIC-NEXT: movl %eax, 64(%rcx)
; LINUX-64-PIC-NEXT: retq
;
; DARWIN-32-STATIC-LABEL: qxx00:
; DARWIN-32-STATIC: ## %bb.0: ## %entry
; DARWIN-32-STATIC-NEXT: movl _xsrc+64, %eax
; DARWIN-32-STATIC-NEXT: movl %eax, _xdst+64
; DARWIN-32-STATIC-NEXT: retl
;
; DARWIN-32-DYNAMIC-LABEL: qxx00:
; DARWIN-32-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-32-DYNAMIC-NEXT: movl L_xsrc$non_lazy_ptr, %eax
; DARWIN-32-DYNAMIC-NEXT: movl 64(%eax), %eax
; DARWIN-32-DYNAMIC-NEXT: movl L_xdst$non_lazy_ptr, %ecx
; DARWIN-32-DYNAMIC-NEXT: movl %eax, 64(%ecx)
; DARWIN-32-DYNAMIC-NEXT: retl
;
; DARWIN-32-PIC-LABEL: qxx00:
; DARWIN-32-PIC: ## %bb.0: ## %entry
; DARWIN-32-PIC-NEXT: calll L13$pb
; DARWIN-32-PIC-NEXT: L13$pb:
; DARWIN-32-PIC-NEXT: popl %eax
; DARWIN-32-PIC-NEXT: movl L_xsrc$non_lazy_ptr-L13$pb(%eax), %ecx
; DARWIN-32-PIC-NEXT: movl 64(%ecx), %ecx
; DARWIN-32-PIC-NEXT: movl L_xdst$non_lazy_ptr-L13$pb(%eax), %eax
; DARWIN-32-PIC-NEXT: movl %ecx, 64(%eax)
; DARWIN-32-PIC-NEXT: retl
;
; DARWIN-64-STATIC-LABEL: qxx00:
; DARWIN-64-STATIC: ## %bb.0: ## %entry
; DARWIN-64-STATIC-NEXT: movq _xsrc@GOTPCREL(%rip), %rax
; DARWIN-64-STATIC-NEXT: movl 64(%rax), %eax
; DARWIN-64-STATIC-NEXT: movq _xdst@GOTPCREL(%rip), %rcx
; DARWIN-64-STATIC-NEXT: movl %eax, 64(%rcx)
; DARWIN-64-STATIC-NEXT: retq
;
; DARWIN-64-DYNAMIC-LABEL: qxx00:
; DARWIN-64-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-64-DYNAMIC-NEXT: movq _xsrc@GOTPCREL(%rip), %rax
; DARWIN-64-DYNAMIC-NEXT: movl 64(%rax), %eax
; DARWIN-64-DYNAMIC-NEXT: movq _xdst@GOTPCREL(%rip), %rcx
; DARWIN-64-DYNAMIC-NEXT: movl %eax, 64(%rcx)
; DARWIN-64-DYNAMIC-NEXT: retq
;
; DARWIN-64-PIC-LABEL: qxx00:
; DARWIN-64-PIC: ## %bb.0: ## %entry
; DARWIN-64-PIC-NEXT: movq _xsrc@GOTPCREL(%rip), %rax
; DARWIN-64-PIC-NEXT: movl 64(%rax), %eax
; DARWIN-64-PIC-NEXT: movq _xdst@GOTPCREL(%rip), %rcx
; DARWIN-64-PIC-NEXT: movl %eax, 64(%rcx)
; DARWIN-64-PIC-NEXT: retq
entry:
%0 = load i32, i32* getelementptr ([32 x i32], [32 x i32]* @xsrc, i32 0, i64 16), align 4
store i32 %0, i32* getelementptr ([32 x i32], [32 x i32]* @xdst, i32 0, i64 16), align 4
ret void
}
define void @qux01() nounwind {
; LINUX-64-STATIC-LABEL: qux01:
; LINUX-64-STATIC: # %bb.0: # %entry
; LINUX-64-STATIC-NEXT: movq $dst+64, ptr(%rip)
; LINUX-64-STATIC-NEXT: retq
;
; LINUX-32-STATIC-LABEL: qux01:
; LINUX-32-STATIC: # %bb.0: # %entry
; LINUX-32-STATIC-NEXT: movl $dst+64, ptr
; LINUX-32-STATIC-NEXT: retl
;
; LINUX-32-PIC-LABEL: qux01:
; LINUX-32-PIC: # %bb.0: # %entry
; LINUX-32-PIC-NEXT: movl $dst+64, ptr
; LINUX-32-PIC-NEXT: retl
;
; LINUX-64-PIC-LABEL: qux01:
; LINUX-64-PIC: # %bb.0: # %entry
; LINUX-64-PIC-NEXT: movq dst@GOTPCREL(%rip), %rax
; LINUX-64-PIC-NEXT: addq $64, %rax
; LINUX-64-PIC-NEXT: movq ptr@GOTPCREL(%rip), %rcx
; LINUX-64-PIC-NEXT: movq %rax, (%rcx)
; LINUX-64-PIC-NEXT: retq
;
; DARWIN-32-STATIC-LABEL: qux01:
; DARWIN-32-STATIC: ## %bb.0: ## %entry
; DARWIN-32-STATIC-NEXT: movl $_dst+64, _ptr
; DARWIN-32-STATIC-NEXT: retl
;
; DARWIN-32-DYNAMIC-LABEL: qux01:
; DARWIN-32-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-32-DYNAMIC-NEXT: movl L_dst$non_lazy_ptr, %eax
; DARWIN-32-DYNAMIC-NEXT: addl $64, %eax
; DARWIN-32-DYNAMIC-NEXT: movl L_ptr$non_lazy_ptr, %ecx
; DARWIN-32-DYNAMIC-NEXT: movl %eax, (%ecx)
; DARWIN-32-DYNAMIC-NEXT: retl
;
; DARWIN-32-PIC-LABEL: qux01:
; DARWIN-32-PIC: ## %bb.0: ## %entry
; DARWIN-32-PIC-NEXT: calll L14$pb
; DARWIN-32-PIC-NEXT: L14$pb:
; DARWIN-32-PIC-NEXT: popl %eax
; DARWIN-32-PIC-NEXT: movl L_dst$non_lazy_ptr-L14$pb(%eax), %ecx
; DARWIN-32-PIC-NEXT: addl $64, %ecx
; DARWIN-32-PIC-NEXT: movl L_ptr$non_lazy_ptr-L14$pb(%eax), %eax
; DARWIN-32-PIC-NEXT: movl %ecx, (%eax)
; DARWIN-32-PIC-NEXT: retl
;
; DARWIN-64-STATIC-LABEL: qux01:
; DARWIN-64-STATIC: ## %bb.0: ## %entry
; DARWIN-64-STATIC-NEXT: movq _dst@GOTPCREL(%rip), %rax
; DARWIN-64-STATIC-NEXT: addq $64, %rax
; DARWIN-64-STATIC-NEXT: movq _ptr@GOTPCREL(%rip), %rcx
; DARWIN-64-STATIC-NEXT: movq %rax, (%rcx)
; DARWIN-64-STATIC-NEXT: retq
;
; DARWIN-64-DYNAMIC-LABEL: qux01:
; DARWIN-64-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-64-DYNAMIC-NEXT: movq _dst@GOTPCREL(%rip), %rax
; DARWIN-64-DYNAMIC-NEXT: addq $64, %rax
; DARWIN-64-DYNAMIC-NEXT: movq _ptr@GOTPCREL(%rip), %rcx
; DARWIN-64-DYNAMIC-NEXT: movq %rax, (%rcx)
; DARWIN-64-DYNAMIC-NEXT: retq
;
; DARWIN-64-PIC-LABEL: qux01:
; DARWIN-64-PIC: ## %bb.0: ## %entry
; DARWIN-64-PIC-NEXT: movq _dst@GOTPCREL(%rip), %rax
; DARWIN-64-PIC-NEXT: addq $64, %rax
; DARWIN-64-PIC-NEXT: movq _ptr@GOTPCREL(%rip), %rcx
; DARWIN-64-PIC-NEXT: movq %rax, (%rcx)
; DARWIN-64-PIC-NEXT: retq
entry:
store i32* getelementptr ([131072 x i32], [131072 x i32]* @dst, i32 0, i64 16), i32** @ptr, align 8
ret void
}
define void @qxx01() nounwind {
; LINUX-64-STATIC-LABEL: qxx01:
; LINUX-64-STATIC: # %bb.0: # %entry
; LINUX-64-STATIC-NEXT: movq $xdst+64, ptr(%rip)
; LINUX-64-STATIC-NEXT: retq
;
; LINUX-32-STATIC-LABEL: qxx01:
; LINUX-32-STATIC: # %bb.0: # %entry
; LINUX-32-STATIC-NEXT: movl $xdst+64, ptr
; LINUX-32-STATIC-NEXT: retl
;
; LINUX-32-PIC-LABEL: qxx01:
; LINUX-32-PIC: # %bb.0: # %entry
; LINUX-32-PIC-NEXT: movl $xdst+64, ptr
; LINUX-32-PIC-NEXT: retl
;
; LINUX-64-PIC-LABEL: qxx01:
; LINUX-64-PIC: # %bb.0: # %entry
; LINUX-64-PIC-NEXT: movq xdst@GOTPCREL(%rip), %rax
; LINUX-64-PIC-NEXT: addq $64, %rax
; LINUX-64-PIC-NEXT: movq ptr@GOTPCREL(%rip), %rcx
; LINUX-64-PIC-NEXT: movq %rax, (%rcx)
; LINUX-64-PIC-NEXT: retq
;
; DARWIN-32-STATIC-LABEL: qxx01:
; DARWIN-32-STATIC: ## %bb.0: ## %entry
; DARWIN-32-STATIC-NEXT: movl $_xdst+64, _ptr
; DARWIN-32-STATIC-NEXT: retl
;
; DARWIN-32-DYNAMIC-LABEL: qxx01:
; DARWIN-32-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-32-DYNAMIC-NEXT: movl L_xdst$non_lazy_ptr, %eax
; DARWIN-32-DYNAMIC-NEXT: addl $64, %eax
; DARWIN-32-DYNAMIC-NEXT: movl L_ptr$non_lazy_ptr, %ecx
; DARWIN-32-DYNAMIC-NEXT: movl %eax, (%ecx)
; DARWIN-32-DYNAMIC-NEXT: retl
;
; DARWIN-32-PIC-LABEL: qxx01:
; DARWIN-32-PIC: ## %bb.0: ## %entry
; DARWIN-32-PIC-NEXT: calll L15$pb
; DARWIN-32-PIC-NEXT: L15$pb:
; DARWIN-32-PIC-NEXT: popl %eax
; DARWIN-32-PIC-NEXT: movl L_xdst$non_lazy_ptr-L15$pb(%eax), %ecx
; DARWIN-32-PIC-NEXT: addl $64, %ecx
; DARWIN-32-PIC-NEXT: movl L_ptr$non_lazy_ptr-L15$pb(%eax), %eax
; DARWIN-32-PIC-NEXT: movl %ecx, (%eax)
; DARWIN-32-PIC-NEXT: retl
;
; DARWIN-64-STATIC-LABEL: qxx01:
; DARWIN-64-STATIC: ## %bb.0: ## %entry
; DARWIN-64-STATIC-NEXT: movq _xdst@GOTPCREL(%rip), %rax
; DARWIN-64-STATIC-NEXT: addq $64, %rax
; DARWIN-64-STATIC-NEXT: movq _ptr@GOTPCREL(%rip), %rcx
; DARWIN-64-STATIC-NEXT: movq %rax, (%rcx)
; DARWIN-64-STATIC-NEXT: retq
;
; DARWIN-64-DYNAMIC-LABEL: qxx01:
; DARWIN-64-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-64-DYNAMIC-NEXT: movq _xdst@GOTPCREL(%rip), %rax
; DARWIN-64-DYNAMIC-NEXT: addq $64, %rax
; DARWIN-64-DYNAMIC-NEXT: movq _ptr@GOTPCREL(%rip), %rcx
; DARWIN-64-DYNAMIC-NEXT: movq %rax, (%rcx)
; DARWIN-64-DYNAMIC-NEXT: retq
;
; DARWIN-64-PIC-LABEL: qxx01:
; DARWIN-64-PIC: ## %bb.0: ## %entry
; DARWIN-64-PIC-NEXT: movq _xdst@GOTPCREL(%rip), %rax
; DARWIN-64-PIC-NEXT: addq $64, %rax
; DARWIN-64-PIC-NEXT: movq _ptr@GOTPCREL(%rip), %rcx
; DARWIN-64-PIC-NEXT: movq %rax, (%rcx)
; DARWIN-64-PIC-NEXT: retq
entry:
store i32* getelementptr ([32 x i32], [32 x i32]* @xdst, i32 0, i64 16), i32** @ptr, align 8
ret void
}
define void @qux02() nounwind {
; LINUX-64-STATIC-LABEL: qux02:
; LINUX-64-STATIC: # %bb.0: # %entry
; LINUX-64-STATIC-NEXT: movl src+64(%rip), %eax
; LINUX-64-STATIC-NEXT: movq ptr(%rip), %rcx
; LINUX-64-STATIC-NEXT: movl %eax, 64(%rcx)
; LINUX-64-STATIC-NEXT: retq
;
; LINUX-32-STATIC-LABEL: qux02:
; LINUX-32-STATIC: # %bb.0: # %entry
; LINUX-32-STATIC-NEXT: movl src+64, %eax
; LINUX-32-STATIC-NEXT: movl ptr, %ecx
; LINUX-32-STATIC-NEXT: movl %eax, 64(%ecx)
; LINUX-32-STATIC-NEXT: retl
;
; LINUX-32-PIC-LABEL: qux02:
; LINUX-32-PIC: # %bb.0: # %entry
; LINUX-32-PIC-NEXT: movl src+64, %eax
; LINUX-32-PIC-NEXT: movl ptr, %ecx
; LINUX-32-PIC-NEXT: movl %eax, 64(%ecx)
; LINUX-32-PIC-NEXT: retl
;
; LINUX-64-PIC-LABEL: qux02:
; LINUX-64-PIC: # %bb.0: # %entry
; LINUX-64-PIC-NEXT: movq src@GOTPCREL(%rip), %rax
; LINUX-64-PIC-NEXT: movl 64(%rax), %eax
; LINUX-64-PIC-NEXT: movq ptr@GOTPCREL(%rip), %rcx
; LINUX-64-PIC-NEXT: movq (%rcx), %rcx
; LINUX-64-PIC-NEXT: movl %eax, 64(%rcx)
; LINUX-64-PIC-NEXT: retq
;
; DARWIN-32-STATIC-LABEL: qux02:
; DARWIN-32-STATIC: ## %bb.0: ## %entry
; DARWIN-32-STATIC-NEXT: movl _src+64, %eax
; DARWIN-32-STATIC-NEXT: movl _ptr, %ecx
; DARWIN-32-STATIC-NEXT: movl %eax, 64(%ecx)
; DARWIN-32-STATIC-NEXT: retl
;
; DARWIN-32-DYNAMIC-LABEL: qux02:
; DARWIN-32-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-32-DYNAMIC-NEXT: movl L_src$non_lazy_ptr, %eax
; DARWIN-32-DYNAMIC-NEXT: movl 64(%eax), %eax
; DARWIN-32-DYNAMIC-NEXT: movl L_ptr$non_lazy_ptr, %ecx
; DARWIN-32-DYNAMIC-NEXT: movl (%ecx), %ecx
; DARWIN-32-DYNAMIC-NEXT: movl %eax, 64(%ecx)
; DARWIN-32-DYNAMIC-NEXT: retl
;
; DARWIN-32-PIC-LABEL: qux02:
; DARWIN-32-PIC: ## %bb.0: ## %entry
; DARWIN-32-PIC-NEXT: calll L16$pb
; DARWIN-32-PIC-NEXT: L16$pb:
; DARWIN-32-PIC-NEXT: popl %eax
; DARWIN-32-PIC-NEXT: movl L_src$non_lazy_ptr-L16$pb(%eax), %ecx
; DARWIN-32-PIC-NEXT: movl 64(%ecx), %ecx
; DARWIN-32-PIC-NEXT: movl L_ptr$non_lazy_ptr-L16$pb(%eax), %eax
; DARWIN-32-PIC-NEXT: movl (%eax), %eax
; DARWIN-32-PIC-NEXT: movl %ecx, 64(%eax)
; DARWIN-32-PIC-NEXT: retl
;
; DARWIN-64-STATIC-LABEL: qux02:
; DARWIN-64-STATIC: ## %bb.0: ## %entry
; DARWIN-64-STATIC-NEXT: movq _src@GOTPCREL(%rip), %rax
; DARWIN-64-STATIC-NEXT: movl 64(%rax), %eax
; DARWIN-64-STATIC-NEXT: movq _ptr@GOTPCREL(%rip), %rcx
; DARWIN-64-STATIC-NEXT: movq (%rcx), %rcx
; DARWIN-64-STATIC-NEXT: movl %eax, 64(%rcx)
; DARWIN-64-STATIC-NEXT: retq
;
; DARWIN-64-DYNAMIC-LABEL: qux02:
; DARWIN-64-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-64-DYNAMIC-NEXT: movq _src@GOTPCREL(%rip), %rax
; DARWIN-64-DYNAMIC-NEXT: movl 64(%rax), %eax
; DARWIN-64-DYNAMIC-NEXT: movq _ptr@GOTPCREL(%rip), %rcx
; DARWIN-64-DYNAMIC-NEXT: movq (%rcx), %rcx
; DARWIN-64-DYNAMIC-NEXT: movl %eax, 64(%rcx)
; DARWIN-64-DYNAMIC-NEXT: retq
;
; DARWIN-64-PIC-LABEL: qux02:
; DARWIN-64-PIC: ## %bb.0: ## %entry
; DARWIN-64-PIC-NEXT: movq _src@GOTPCREL(%rip), %rax
; DARWIN-64-PIC-NEXT: movl 64(%rax), %eax
; DARWIN-64-PIC-NEXT: movq _ptr@GOTPCREL(%rip), %rcx
; DARWIN-64-PIC-NEXT: movq (%rcx), %rcx
; DARWIN-64-PIC-NEXT: movl %eax, 64(%rcx)
; DARWIN-64-PIC-NEXT: retq
entry:
%0 = load i32*, i32** @ptr, align 8
%1 = load i32, i32* getelementptr ([131072 x i32], [131072 x i32]* @src, i32 0, i64 16), align 4
%2 = getelementptr i32, i32* %0, i64 16
store i32 %1, i32* %2, align 4
ret void
}
define void @qxx02() nounwind {
; LINUX-64-STATIC-LABEL: qxx02:
; LINUX-64-STATIC: # %bb.0: # %entry
; LINUX-64-STATIC-NEXT: movl xsrc+64(%rip), %eax
; LINUX-64-STATIC-NEXT: movq ptr(%rip), %rcx
; LINUX-64-STATIC-NEXT: movl %eax, 64(%rcx)
; LINUX-64-STATIC-NEXT: retq
;
; LINUX-32-STATIC-LABEL: qxx02:
; LINUX-32-STATIC: # %bb.0: # %entry
; LINUX-32-STATIC-NEXT: movl xsrc+64, %eax
; LINUX-32-STATIC-NEXT: movl ptr, %ecx
; LINUX-32-STATIC-NEXT: movl %eax, 64(%ecx)
; LINUX-32-STATIC-NEXT: retl
;
; LINUX-32-PIC-LABEL: qxx02:
; LINUX-32-PIC: # %bb.0: # %entry
; LINUX-32-PIC-NEXT: movl xsrc+64, %eax
; LINUX-32-PIC-NEXT: movl ptr, %ecx
; LINUX-32-PIC-NEXT: movl %eax, 64(%ecx)
; LINUX-32-PIC-NEXT: retl
;
; LINUX-64-PIC-LABEL: qxx02:
; LINUX-64-PIC: # %bb.0: # %entry
; LINUX-64-PIC-NEXT: movq xsrc@GOTPCREL(%rip), %rax
; LINUX-64-PIC-NEXT: movl 64(%rax), %eax
; LINUX-64-PIC-NEXT: movq ptr@GOTPCREL(%rip), %rcx
; LINUX-64-PIC-NEXT: movq (%rcx), %rcx
; LINUX-64-PIC-NEXT: movl %eax, 64(%rcx)
; LINUX-64-PIC-NEXT: retq
;
; DARWIN-32-STATIC-LABEL: qxx02:
; DARWIN-32-STATIC: ## %bb.0: ## %entry
; DARWIN-32-STATIC-NEXT: movl _xsrc+64, %eax
; DARWIN-32-STATIC-NEXT: movl _ptr, %ecx
; DARWIN-32-STATIC-NEXT: movl %eax, 64(%ecx)
; DARWIN-32-STATIC-NEXT: retl
;
; DARWIN-32-DYNAMIC-LABEL: qxx02:
; DARWIN-32-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-32-DYNAMIC-NEXT: movl L_xsrc$non_lazy_ptr, %eax
; DARWIN-32-DYNAMIC-NEXT: movl 64(%eax), %eax
; DARWIN-32-DYNAMIC-NEXT: movl L_ptr$non_lazy_ptr, %ecx
; DARWIN-32-DYNAMIC-NEXT: movl (%ecx), %ecx
; DARWIN-32-DYNAMIC-NEXT: movl %eax, 64(%ecx)
; DARWIN-32-DYNAMIC-NEXT: retl
;
; DARWIN-32-PIC-LABEL: qxx02:
; DARWIN-32-PIC: ## %bb.0: ## %entry
; DARWIN-32-PIC-NEXT: calll L17$pb
; DARWIN-32-PIC-NEXT: L17$pb:
; DARWIN-32-PIC-NEXT: popl %eax
; DARWIN-32-PIC-NEXT: movl L_xsrc$non_lazy_ptr-L17$pb(%eax), %ecx
; DARWIN-32-PIC-NEXT: movl 64(%ecx), %ecx
; DARWIN-32-PIC-NEXT: movl L_ptr$non_lazy_ptr-L17$pb(%eax), %eax
; DARWIN-32-PIC-NEXT: movl (%eax), %eax
; DARWIN-32-PIC-NEXT: movl %ecx, 64(%eax)
; DARWIN-32-PIC-NEXT: retl
;
; DARWIN-64-STATIC-LABEL: qxx02:
; DARWIN-64-STATIC: ## %bb.0: ## %entry
; DARWIN-64-STATIC-NEXT: movq _xsrc@GOTPCREL(%rip), %rax
; DARWIN-64-STATIC-NEXT: movl 64(%rax), %eax
; DARWIN-64-STATIC-NEXT: movq _ptr@GOTPCREL(%rip), %rcx
; DARWIN-64-STATIC-NEXT: movq (%rcx), %rcx
; DARWIN-64-STATIC-NEXT: movl %eax, 64(%rcx)
; DARWIN-64-STATIC-NEXT: retq
;
; DARWIN-64-DYNAMIC-LABEL: qxx02:
; DARWIN-64-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-64-DYNAMIC-NEXT: movq _xsrc@GOTPCREL(%rip), %rax
; DARWIN-64-DYNAMIC-NEXT: movl 64(%rax), %eax
; DARWIN-64-DYNAMIC-NEXT: movq _ptr@GOTPCREL(%rip), %rcx
; DARWIN-64-DYNAMIC-NEXT: movq (%rcx), %rcx
; DARWIN-64-DYNAMIC-NEXT: movl %eax, 64(%rcx)
; DARWIN-64-DYNAMIC-NEXT: retq
;
; DARWIN-64-PIC-LABEL: qxx02:
; DARWIN-64-PIC: ## %bb.0: ## %entry
; DARWIN-64-PIC-NEXT: movq _xsrc@GOTPCREL(%rip), %rax
; DARWIN-64-PIC-NEXT: movl 64(%rax), %eax
; DARWIN-64-PIC-NEXT: movq _ptr@GOTPCREL(%rip), %rcx
; DARWIN-64-PIC-NEXT: movq (%rcx), %rcx
; DARWIN-64-PIC-NEXT: movl %eax, 64(%rcx)
; DARWIN-64-PIC-NEXT: retq
entry:
%0 = load i32*, i32** @ptr, align 8
%1 = load i32, i32* getelementptr ([32 x i32], [32 x i32]* @xsrc, i32 0, i64 16), align 4
%2 = getelementptr i32, i32* %0, i64 16
store i32 %1, i32* %2, align 4
ret void
}
define void @qux03() nounwind {
; LINUX-64-STATIC-LABEL: qux03:
; LINUX-64-STATIC: # %bb.0: # %entry
; LINUX-64-STATIC-NEXT: movl dsrc+64(%rip), %eax
; LINUX-64-STATIC-NEXT: movl %eax, ddst+64(%rip)
; LINUX-64-STATIC-NEXT: retq
;
; LINUX-32-STATIC-LABEL: qux03:
; LINUX-32-STATIC: # %bb.0: # %entry
; LINUX-32-STATIC-NEXT: movl dsrc+64, %eax
; LINUX-32-STATIC-NEXT: movl %eax, ddst+64
; LINUX-32-STATIC-NEXT: retl
;
; LINUX-32-PIC-LABEL: qux03:
; LINUX-32-PIC: # %bb.0: # %entry
; LINUX-32-PIC-NEXT: movl dsrc+64, %eax
; LINUX-32-PIC-NEXT: movl %eax, ddst+64
; LINUX-32-PIC-NEXT: retl
;
; LINUX-64-PIC-LABEL: qux03:
; LINUX-64-PIC: # %bb.0: # %entry
; LINUX-64-PIC-NEXT: movq dsrc@GOTPCREL(%rip), %rax
; LINUX-64-PIC-NEXT: movl 64(%rax), %eax
; LINUX-64-PIC-NEXT: movq ddst@GOTPCREL(%rip), %rcx
; LINUX-64-PIC-NEXT: movl %eax, 64(%rcx)
; LINUX-64-PIC-NEXT: retq
;
; DARWIN-32-STATIC-LABEL: qux03:
; DARWIN-32-STATIC: ## %bb.0: ## %entry
; DARWIN-32-STATIC-NEXT: movl _dsrc+64, %eax
; DARWIN-32-STATIC-NEXT: movl %eax, _ddst+64
; DARWIN-32-STATIC-NEXT: retl
;
; DARWIN-32-DYNAMIC-LABEL: qux03:
; DARWIN-32-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-32-DYNAMIC-NEXT: movl _dsrc+64, %eax
; DARWIN-32-DYNAMIC-NEXT: movl %eax, _ddst+64
; DARWIN-32-DYNAMIC-NEXT: retl
;
; DARWIN-32-PIC-LABEL: qux03:
; DARWIN-32-PIC: ## %bb.0: ## %entry
; DARWIN-32-PIC-NEXT: calll L18$pb
; DARWIN-32-PIC-NEXT: L18$pb:
; DARWIN-32-PIC-NEXT: popl %eax
; DARWIN-32-PIC-NEXT: movl (_dsrc-L18$pb)+64(%eax), %ecx
; DARWIN-32-PIC-NEXT: movl %ecx, (_ddst-L18$pb)+64(%eax)
; DARWIN-32-PIC-NEXT: retl
;
; DARWIN-64-STATIC-LABEL: qux03:
; DARWIN-64-STATIC: ## %bb.0: ## %entry
; DARWIN-64-STATIC-NEXT: movl _dsrc+64(%rip), %eax
; DARWIN-64-STATIC-NEXT: movl %eax, _ddst+64(%rip)
; DARWIN-64-STATIC-NEXT: retq
;
; DARWIN-64-DYNAMIC-LABEL: qux03:
; DARWIN-64-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-64-DYNAMIC-NEXT: movl _dsrc+64(%rip), %eax
; DARWIN-64-DYNAMIC-NEXT: movl %eax, _ddst+64(%rip)
; DARWIN-64-DYNAMIC-NEXT: retq
;
; DARWIN-64-PIC-LABEL: qux03:
; DARWIN-64-PIC: ## %bb.0: ## %entry
; DARWIN-64-PIC-NEXT: movl _dsrc+64(%rip), %eax
; DARWIN-64-PIC-NEXT: movl %eax, _ddst+64(%rip)
; DARWIN-64-PIC-NEXT: retq
entry:
%0 = load i32, i32* getelementptr ([131072 x i32], [131072 x i32]* @dsrc, i32 0, i64 16), align 32
store i32 %0, i32* getelementptr ([131072 x i32], [131072 x i32]* @ddst, i32 0, i64 16), align 32
ret void
}
define void @qux04() nounwind {
; LINUX-64-STATIC-LABEL: qux04:
; LINUX-64-STATIC: # %bb.0: # %entry
; LINUX-64-STATIC-NEXT: movq $ddst+64, dptr(%rip)
; LINUX-64-STATIC-NEXT: retq
;
; LINUX-32-STATIC-LABEL: qux04:
; LINUX-32-STATIC: # %bb.0: # %entry
; LINUX-32-STATIC-NEXT: movl $ddst+64, dptr
; LINUX-32-STATIC-NEXT: retl
;
; LINUX-32-PIC-LABEL: qux04:
; LINUX-32-PIC: # %bb.0: # %entry
; LINUX-32-PIC-NEXT: movl $ddst+64, dptr
; LINUX-32-PIC-NEXT: retl
;
; LINUX-64-PIC-LABEL: qux04:
; LINUX-64-PIC: # %bb.0: # %entry
; LINUX-64-PIC-NEXT: movq ddst@GOTPCREL(%rip), %rax
; LINUX-64-PIC-NEXT: addq $64, %rax
; LINUX-64-PIC-NEXT: movq dptr@GOTPCREL(%rip), %rcx
; LINUX-64-PIC-NEXT: movq %rax, (%rcx)
; LINUX-64-PIC-NEXT: retq
;
; DARWIN-32-STATIC-LABEL: qux04:
; DARWIN-32-STATIC: ## %bb.0: ## %entry
; DARWIN-32-STATIC-NEXT: movl $_ddst+64, _dptr
; DARWIN-32-STATIC-NEXT: retl
;
; DARWIN-32-DYNAMIC-LABEL: qux04:
; DARWIN-32-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-32-DYNAMIC-NEXT: movl $_ddst+64, _dptr
; DARWIN-32-DYNAMIC-NEXT: retl
;
; DARWIN-32-PIC-LABEL: qux04:
; DARWIN-32-PIC: ## %bb.0: ## %entry
; DARWIN-32-PIC-NEXT: calll L19$pb
; DARWIN-32-PIC-NEXT: L19$pb:
; DARWIN-32-PIC-NEXT: popl %eax
; DARWIN-32-PIC-NEXT: leal (_ddst-L19$pb)+64(%eax), %ecx
; DARWIN-32-PIC-NEXT: movl %ecx, _dptr-L19$pb(%eax)
; DARWIN-32-PIC-NEXT: retl
;
; DARWIN-64-STATIC-LABEL: qux04:
; DARWIN-64-STATIC: ## %bb.0: ## %entry
; DARWIN-64-STATIC-NEXT: leaq _ddst+64(%rip), %rax
; DARWIN-64-STATIC-NEXT: movq %rax, _dptr(%rip)
; DARWIN-64-STATIC-NEXT: retq
;
; DARWIN-64-DYNAMIC-LABEL: qux04:
; DARWIN-64-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-64-DYNAMIC-NEXT: leaq _ddst+64(%rip), %rax
; DARWIN-64-DYNAMIC-NEXT: movq %rax, _dptr(%rip)
; DARWIN-64-DYNAMIC-NEXT: retq
;
; DARWIN-64-PIC-LABEL: qux04:
; DARWIN-64-PIC: ## %bb.0: ## %entry
; DARWIN-64-PIC-NEXT: leaq _ddst+64(%rip), %rax
; DARWIN-64-PIC-NEXT: movq %rax, _dptr(%rip)
; DARWIN-64-PIC-NEXT: retq
entry:
store i32* getelementptr ([131072 x i32], [131072 x i32]* @ddst, i32 0, i64 16), i32** @dptr, align 8
ret void
}
define void @qux05() nounwind {
; LINUX-64-STATIC-LABEL: qux05:
; LINUX-64-STATIC: # %bb.0: # %entry
; LINUX-64-STATIC-NEXT: movl dsrc+64(%rip), %eax
; LINUX-64-STATIC-NEXT: movq dptr(%rip), %rcx
; LINUX-64-STATIC-NEXT: movl %eax, 64(%rcx)
; LINUX-64-STATIC-NEXT: retq
;
; LINUX-32-STATIC-LABEL: qux05:
; LINUX-32-STATIC: # %bb.0: # %entry
; LINUX-32-STATIC-NEXT: movl dsrc+64, %eax
; LINUX-32-STATIC-NEXT: movl dptr, %ecx
; LINUX-32-STATIC-NEXT: movl %eax, 64(%ecx)
; LINUX-32-STATIC-NEXT: retl
;
; LINUX-32-PIC-LABEL: qux05:
; LINUX-32-PIC: # %bb.0: # %entry
; LINUX-32-PIC-NEXT: movl dsrc+64, %eax
; LINUX-32-PIC-NEXT: movl dptr, %ecx
; LINUX-32-PIC-NEXT: movl %eax, 64(%ecx)
; LINUX-32-PIC-NEXT: retl
;
; LINUX-64-PIC-LABEL: qux05:
; LINUX-64-PIC: # %bb.0: # %entry
; LINUX-64-PIC-NEXT: movq dsrc@GOTPCREL(%rip), %rax
; LINUX-64-PIC-NEXT: movl 64(%rax), %eax
; LINUX-64-PIC-NEXT: movq dptr@GOTPCREL(%rip), %rcx
; LINUX-64-PIC-NEXT: movq (%rcx), %rcx
; LINUX-64-PIC-NEXT: movl %eax, 64(%rcx)
; LINUX-64-PIC-NEXT: retq
;
; DARWIN-32-STATIC-LABEL: qux05:
; DARWIN-32-STATIC: ## %bb.0: ## %entry
; DARWIN-32-STATIC-NEXT: movl _dsrc+64, %eax
; DARWIN-32-STATIC-NEXT: movl _dptr, %ecx
; DARWIN-32-STATIC-NEXT: movl %eax, 64(%ecx)
; DARWIN-32-STATIC-NEXT: retl
;
; DARWIN-32-DYNAMIC-LABEL: qux05:
; DARWIN-32-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-32-DYNAMIC-NEXT: movl _dsrc+64, %eax
; DARWIN-32-DYNAMIC-NEXT: movl _dptr, %ecx
; DARWIN-32-DYNAMIC-NEXT: movl %eax, 64(%ecx)
; DARWIN-32-DYNAMIC-NEXT: retl
;
; DARWIN-32-PIC-LABEL: qux05:
; DARWIN-32-PIC: ## %bb.0: ## %entry
; DARWIN-32-PIC-NEXT: calll L20$pb
; DARWIN-32-PIC-NEXT: L20$pb:
; DARWIN-32-PIC-NEXT: popl %eax
; DARWIN-32-PIC-NEXT: movl (_dsrc-L20$pb)+64(%eax), %ecx
; DARWIN-32-PIC-NEXT: movl _dptr-L20$pb(%eax), %eax
; DARWIN-32-PIC-NEXT: movl %ecx, 64(%eax)
; DARWIN-32-PIC-NEXT: retl
;
; DARWIN-64-STATIC-LABEL: qux05:
; DARWIN-64-STATIC: ## %bb.0: ## %entry
; DARWIN-64-STATIC-NEXT: movl _dsrc+64(%rip), %eax
; DARWIN-64-STATIC-NEXT: movq _dptr(%rip), %rcx
; DARWIN-64-STATIC-NEXT: movl %eax, 64(%rcx)
; DARWIN-64-STATIC-NEXT: retq
;
; DARWIN-64-DYNAMIC-LABEL: qux05:
; DARWIN-64-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-64-DYNAMIC-NEXT: movl _dsrc+64(%rip), %eax
; DARWIN-64-DYNAMIC-NEXT: movq _dptr(%rip), %rcx
; DARWIN-64-DYNAMIC-NEXT: movl %eax, 64(%rcx)
; DARWIN-64-DYNAMIC-NEXT: retq
;
; DARWIN-64-PIC-LABEL: qux05:
; DARWIN-64-PIC: ## %bb.0: ## %entry
; DARWIN-64-PIC-NEXT: movl _dsrc+64(%rip), %eax
; DARWIN-64-PIC-NEXT: movq _dptr(%rip), %rcx
; DARWIN-64-PIC-NEXT: movl %eax, 64(%rcx)
; DARWIN-64-PIC-NEXT: retq
entry:
%0 = load i32*, i32** @dptr, align 8
%1 = load i32, i32* getelementptr ([131072 x i32], [131072 x i32]* @dsrc, i32 0, i64 16), align 32
%2 = getelementptr i32, i32* %0, i64 16
store i32 %1, i32* %2, align 4
ret void
}
define void @qux06() nounwind {
; LINUX-64-STATIC-LABEL: qux06:
; LINUX-64-STATIC: # %bb.0: # %entry
; LINUX-64-STATIC-NEXT: movl lsrc+64(%rip), %eax
; LINUX-64-STATIC-NEXT: movl %eax, ldst+64(%rip)
; LINUX-64-STATIC-NEXT: retq
;
; LINUX-32-STATIC-LABEL: qux06:
; LINUX-32-STATIC: # %bb.0: # %entry
; LINUX-32-STATIC-NEXT: movl lsrc+64, %eax
; LINUX-32-STATIC-NEXT: movl %eax, ldst+64
; LINUX-32-STATIC-NEXT: retl
;
; LINUX-32-PIC-LABEL: qux06:
; LINUX-32-PIC: # %bb.0: # %entry
; LINUX-32-PIC-NEXT: movl lsrc+64, %eax
; LINUX-32-PIC-NEXT: movl %eax, ldst+64
; LINUX-32-PIC-NEXT: retl
;
; LINUX-64-PIC-LABEL: qux06:
; LINUX-64-PIC: # %bb.0: # %entry
; LINUX-64-PIC-NEXT: movl lsrc+64(%rip), %eax
; LINUX-64-PIC-NEXT: movl %eax, ldst+64(%rip)
; LINUX-64-PIC-NEXT: retq
;
; DARWIN-32-STATIC-LABEL: qux06:
; DARWIN-32-STATIC: ## %bb.0: ## %entry
; DARWIN-32-STATIC-NEXT: movl _lsrc+64, %eax
; DARWIN-32-STATIC-NEXT: movl %eax, _ldst+64
; DARWIN-32-STATIC-NEXT: retl
;
; DARWIN-32-DYNAMIC-LABEL: qux06:
; DARWIN-32-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-32-DYNAMIC-NEXT: movl _lsrc+64, %eax
; DARWIN-32-DYNAMIC-NEXT: movl %eax, _ldst+64
; DARWIN-32-DYNAMIC-NEXT: retl
;
; DARWIN-32-PIC-LABEL: qux06:
; DARWIN-32-PIC: ## %bb.0: ## %entry
; DARWIN-32-PIC-NEXT: calll L21$pb
; DARWIN-32-PIC-NEXT: L21$pb:
; DARWIN-32-PIC-NEXT: popl %eax
; DARWIN-32-PIC-NEXT: movl (_lsrc-L21$pb)+64(%eax), %ecx
; DARWIN-32-PIC-NEXT: movl %ecx, (_ldst-L21$pb)+64(%eax)
; DARWIN-32-PIC-NEXT: retl
;
; DARWIN-64-STATIC-LABEL: qux06:
; DARWIN-64-STATIC: ## %bb.0: ## %entry
; DARWIN-64-STATIC-NEXT: movl _lsrc+64(%rip), %eax
; DARWIN-64-STATIC-NEXT: movl %eax, _ldst+64(%rip)
; DARWIN-64-STATIC-NEXT: retq
;
; DARWIN-64-DYNAMIC-LABEL: qux06:
; DARWIN-64-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-64-DYNAMIC-NEXT: movl _lsrc+64(%rip), %eax
; DARWIN-64-DYNAMIC-NEXT: movl %eax, _ldst+64(%rip)
; DARWIN-64-DYNAMIC-NEXT: retq
;
; DARWIN-64-PIC-LABEL: qux06:
; DARWIN-64-PIC: ## %bb.0: ## %entry
; DARWIN-64-PIC-NEXT: movl _lsrc+64(%rip), %eax
; DARWIN-64-PIC-NEXT: movl %eax, _ldst+64(%rip)
; DARWIN-64-PIC-NEXT: retq
entry:
%0 = load i32, i32* getelementptr ([131072 x i32], [131072 x i32]* @lsrc, i32 0, i64 16), align 4
store i32 %0, i32* getelementptr ([131072 x i32], [131072 x i32]* @ldst, i32 0, i64 16), align 4
ret void
}
define void @qux07() nounwind {
; LINUX-64-STATIC-LABEL: qux07:
; LINUX-64-STATIC: # %bb.0: # %entry
; LINUX-64-STATIC-NEXT: movq $ldst+64, lptr(%rip)
; LINUX-64-STATIC-NEXT: retq
;
; LINUX-32-STATIC-LABEL: qux07:
; LINUX-32-STATIC: # %bb.0: # %entry
; LINUX-32-STATIC-NEXT: movl $ldst+64, lptr
; LINUX-32-STATIC-NEXT: retl
;
; LINUX-32-PIC-LABEL: qux07:
; LINUX-32-PIC: # %bb.0: # %entry
; LINUX-32-PIC-NEXT: movl $ldst+64, lptr
; LINUX-32-PIC-NEXT: retl
;
; LINUX-64-PIC-LABEL: qux07:
; LINUX-64-PIC: # %bb.0: # %entry
; LINUX-64-PIC-NEXT: leaq ldst+64(%rip), %rax
; LINUX-64-PIC-NEXT: movq %rax, lptr(%rip)
; LINUX-64-PIC-NEXT: retq
;
; DARWIN-32-STATIC-LABEL: qux07:
; DARWIN-32-STATIC: ## %bb.0: ## %entry
; DARWIN-32-STATIC-NEXT: movl $_ldst+64, _lptr
; DARWIN-32-STATIC-NEXT: retl
;
; DARWIN-32-DYNAMIC-LABEL: qux07:
; DARWIN-32-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-32-DYNAMIC-NEXT: movl $_ldst+64, _lptr
; DARWIN-32-DYNAMIC-NEXT: retl
;
; DARWIN-32-PIC-LABEL: qux07:
; DARWIN-32-PIC: ## %bb.0: ## %entry
; DARWIN-32-PIC-NEXT: calll L22$pb
; DARWIN-32-PIC-NEXT: L22$pb:
; DARWIN-32-PIC-NEXT: popl %eax
; DARWIN-32-PIC-NEXT: leal (_ldst-L22$pb)+64(%eax), %ecx
; DARWIN-32-PIC-NEXT: movl %ecx, _lptr-L22$pb(%eax)
; DARWIN-32-PIC-NEXT: retl
;
; DARWIN-64-STATIC-LABEL: qux07:
; DARWIN-64-STATIC: ## %bb.0: ## %entry
; DARWIN-64-STATIC-NEXT: leaq _ldst+64(%rip), %rax
; DARWIN-64-STATIC-NEXT: movq %rax, _lptr(%rip)
; DARWIN-64-STATIC-NEXT: retq
;
; DARWIN-64-DYNAMIC-LABEL: qux07:
; DARWIN-64-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-64-DYNAMIC-NEXT: leaq _ldst+64(%rip), %rax
; DARWIN-64-DYNAMIC-NEXT: movq %rax, _lptr(%rip)
; DARWIN-64-DYNAMIC-NEXT: retq
;
; DARWIN-64-PIC-LABEL: qux07:
; DARWIN-64-PIC: ## %bb.0: ## %entry
; DARWIN-64-PIC-NEXT: leaq _ldst+64(%rip), %rax
; DARWIN-64-PIC-NEXT: movq %rax, _lptr(%rip)
; DARWIN-64-PIC-NEXT: retq
entry:
store i32* getelementptr ([131072 x i32], [131072 x i32]* @ldst, i32 0, i64 16), i32** @lptr, align 8
ret void
}
define void @qux08() nounwind {
; LINUX-64-STATIC-LABEL: qux08:
; LINUX-64-STATIC: # %bb.0: # %entry
; LINUX-64-STATIC-NEXT: movl lsrc+64(%rip), %eax
; LINUX-64-STATIC-NEXT: movq lptr(%rip), %rcx
; LINUX-64-STATIC-NEXT: movl %eax, 64(%rcx)
; LINUX-64-STATIC-NEXT: retq
;
; LINUX-32-STATIC-LABEL: qux08:
; LINUX-32-STATIC: # %bb.0: # %entry
; LINUX-32-STATIC-NEXT: movl lsrc+64, %eax
; LINUX-32-STATIC-NEXT: movl lptr, %ecx
; LINUX-32-STATIC-NEXT: movl %eax, 64(%ecx)
; LINUX-32-STATIC-NEXT: retl
;
; LINUX-32-PIC-LABEL: qux08:
; LINUX-32-PIC: # %bb.0: # %entry
; LINUX-32-PIC-NEXT: movl lsrc+64, %eax
; LINUX-32-PIC-NEXT: movl lptr, %ecx
; LINUX-32-PIC-NEXT: movl %eax, 64(%ecx)
; LINUX-32-PIC-NEXT: retl
;
; LINUX-64-PIC-LABEL: qux08:
; LINUX-64-PIC: # %bb.0: # %entry
; LINUX-64-PIC-NEXT: movl lsrc+64(%rip), %eax
; LINUX-64-PIC-NEXT: movq lptr(%rip), %rcx
; LINUX-64-PIC-NEXT: movl %eax, 64(%rcx)
; LINUX-64-PIC-NEXT: retq
;
; DARWIN-32-STATIC-LABEL: qux08:
; DARWIN-32-STATIC: ## %bb.0: ## %entry
; DARWIN-32-STATIC-NEXT: movl _lsrc+64, %eax
; DARWIN-32-STATIC-NEXT: movl _lptr, %ecx
; DARWIN-32-STATIC-NEXT: movl %eax, 64(%ecx)
; DARWIN-32-STATIC-NEXT: retl
;
; DARWIN-32-DYNAMIC-LABEL: qux08:
; DARWIN-32-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-32-DYNAMIC-NEXT: movl _lsrc+64, %eax
; DARWIN-32-DYNAMIC-NEXT: movl _lptr, %ecx
; DARWIN-32-DYNAMIC-NEXT: movl %eax, 64(%ecx)
; DARWIN-32-DYNAMIC-NEXT: retl
;
; DARWIN-32-PIC-LABEL: qux08:
; DARWIN-32-PIC: ## %bb.0: ## %entry
; DARWIN-32-PIC-NEXT: calll L23$pb
; DARWIN-32-PIC-NEXT: L23$pb:
; DARWIN-32-PIC-NEXT: popl %eax
; DARWIN-32-PIC-NEXT: movl (_lsrc-L23$pb)+64(%eax), %ecx
; DARWIN-32-PIC-NEXT: movl _lptr-L23$pb(%eax), %eax
; DARWIN-32-PIC-NEXT: movl %ecx, 64(%eax)
; DARWIN-32-PIC-NEXT: retl
;
; DARWIN-64-STATIC-LABEL: qux08:
; DARWIN-64-STATIC: ## %bb.0: ## %entry
; DARWIN-64-STATIC-NEXT: movl _lsrc+64(%rip), %eax
; DARWIN-64-STATIC-NEXT: movq _lptr(%rip), %rcx
; DARWIN-64-STATIC-NEXT: movl %eax, 64(%rcx)
; DARWIN-64-STATIC-NEXT: retq
;
; DARWIN-64-DYNAMIC-LABEL: qux08:
; DARWIN-64-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-64-DYNAMIC-NEXT: movl _lsrc+64(%rip), %eax
; DARWIN-64-DYNAMIC-NEXT: movq _lptr(%rip), %rcx
; DARWIN-64-DYNAMIC-NEXT: movl %eax, 64(%rcx)
; DARWIN-64-DYNAMIC-NEXT: retq
;
; DARWIN-64-PIC-LABEL: qux08:
; DARWIN-64-PIC: ## %bb.0: ## %entry
; DARWIN-64-PIC-NEXT: movl _lsrc+64(%rip), %eax
; DARWIN-64-PIC-NEXT: movq _lptr(%rip), %rcx
; DARWIN-64-PIC-NEXT: movl %eax, 64(%rcx)
; DARWIN-64-PIC-NEXT: retq
entry:
%0 = load i32*, i32** @lptr, align 8
%1 = load i32, i32* getelementptr ([131072 x i32], [131072 x i32]* @lsrc, i32 0, i64 16), align 4
%2 = getelementptr i32, i32* %0, i64 16
store i32 %1, i32* %2, align 4
ret void
}
define void @ind00(i64 %i) nounwind {
; LINUX-64-STATIC-LABEL: ind00:
; LINUX-64-STATIC: # %bb.0: # %entry
; LINUX-64-STATIC-NEXT: movl src(,%rdi,4), %eax
; LINUX-64-STATIC-NEXT: movl %eax, dst(,%rdi,4)
; LINUX-64-STATIC-NEXT: retq
;
; LINUX-32-STATIC-LABEL: ind00:
; LINUX-32-STATIC: # %bb.0: # %entry
; LINUX-32-STATIC-NEXT: movl {{[0-9]+}}(%esp), %eax
; LINUX-32-STATIC-NEXT: movl src(,%eax,4), %ecx
; LINUX-32-STATIC-NEXT: movl %ecx, dst(,%eax,4)
; LINUX-32-STATIC-NEXT: retl
;
; LINUX-32-PIC-LABEL: ind00:
; LINUX-32-PIC: # %bb.0: # %entry
; LINUX-32-PIC-NEXT: movl {{[0-9]+}}(%esp), %eax
; LINUX-32-PIC-NEXT: movl src(,%eax,4), %ecx
; LINUX-32-PIC-NEXT: movl %ecx, dst(,%eax,4)
; LINUX-32-PIC-NEXT: retl
;
; LINUX-64-PIC-LABEL: ind00:
; LINUX-64-PIC: # %bb.0: # %entry
; LINUX-64-PIC-NEXT: movq src@GOTPCREL(%rip), %rax
; LINUX-64-PIC-NEXT: movl (%rax,%rdi,4), %eax
; LINUX-64-PIC-NEXT: movq dst@GOTPCREL(%rip), %rcx
; LINUX-64-PIC-NEXT: movl %eax, (%rcx,%rdi,4)
; LINUX-64-PIC-NEXT: retq
;
; DARWIN-32-STATIC-LABEL: ind00:
; DARWIN-32-STATIC: ## %bb.0: ## %entry
; DARWIN-32-STATIC-NEXT: movl {{[0-9]+}}(%esp), %eax
; DARWIN-32-STATIC-NEXT: movl _src(,%eax,4), %ecx
; DARWIN-32-STATIC-NEXT: movl %ecx, _dst(,%eax,4)
; DARWIN-32-STATIC-NEXT: retl
;
; DARWIN-32-DYNAMIC-LABEL: ind00:
; DARWIN-32-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-32-DYNAMIC-NEXT: movl {{[0-9]+}}(%esp), %eax
; DARWIN-32-DYNAMIC-NEXT: movl L_src$non_lazy_ptr, %ecx
; DARWIN-32-DYNAMIC-NEXT: movl (%ecx,%eax,4), %ecx
; DARWIN-32-DYNAMIC-NEXT: movl L_dst$non_lazy_ptr, %edx
; DARWIN-32-DYNAMIC-NEXT: movl %ecx, (%edx,%eax,4)
; DARWIN-32-DYNAMIC-NEXT: retl
;
; DARWIN-32-PIC-LABEL: ind00:
; DARWIN-32-PIC: ## %bb.0: ## %entry
; DARWIN-32-PIC-NEXT: calll L24$pb
; DARWIN-32-PIC-NEXT: L24$pb:
; DARWIN-32-PIC-NEXT: popl %eax
; DARWIN-32-PIC-NEXT: movl {{[0-9]+}}(%esp), %ecx
; DARWIN-32-PIC-NEXT: movl L_src$non_lazy_ptr-L24$pb(%eax), %edx
; DARWIN-32-PIC-NEXT: movl (%edx,%ecx,4), %edx
; DARWIN-32-PIC-NEXT: movl L_dst$non_lazy_ptr-L24$pb(%eax), %eax
; DARWIN-32-PIC-NEXT: movl %edx, (%eax,%ecx,4)
; DARWIN-32-PIC-NEXT: retl
;
; DARWIN-64-STATIC-LABEL: ind00:
; DARWIN-64-STATIC: ## %bb.0: ## %entry
; DARWIN-64-STATIC-NEXT: movq _src@GOTPCREL(%rip), %rax
; DARWIN-64-STATIC-NEXT: movl (%rax,%rdi,4), %eax
; DARWIN-64-STATIC-NEXT: movq _dst@GOTPCREL(%rip), %rcx
; DARWIN-64-STATIC-NEXT: movl %eax, (%rcx,%rdi,4)
; DARWIN-64-STATIC-NEXT: retq
;
; DARWIN-64-DYNAMIC-LABEL: ind00:
; DARWIN-64-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-64-DYNAMIC-NEXT: movq _src@GOTPCREL(%rip), %rax
; DARWIN-64-DYNAMIC-NEXT: movl (%rax,%rdi,4), %eax
; DARWIN-64-DYNAMIC-NEXT: movq _dst@GOTPCREL(%rip), %rcx
; DARWIN-64-DYNAMIC-NEXT: movl %eax, (%rcx,%rdi,4)
; DARWIN-64-DYNAMIC-NEXT: retq
;
; DARWIN-64-PIC-LABEL: ind00:
; DARWIN-64-PIC: ## %bb.0: ## %entry
; DARWIN-64-PIC-NEXT: movq _src@GOTPCREL(%rip), %rax
; DARWIN-64-PIC-NEXT: movl (%rax,%rdi,4), %eax
; DARWIN-64-PIC-NEXT: movq _dst@GOTPCREL(%rip), %rcx
; DARWIN-64-PIC-NEXT: movl %eax, (%rcx,%rdi,4)
; DARWIN-64-PIC-NEXT: retq
entry:
%0 = getelementptr [131072 x i32], [131072 x i32]* @src, i64 0, i64 %i
%1 = load i32, i32* %0, align 4
%2 = getelementptr [131072 x i32], [131072 x i32]* @dst, i64 0, i64 %i
store i32 %1, i32* %2, align 4
ret void
}
define void @ixd00(i64 %i) nounwind {
; LINUX-64-STATIC-LABEL: ixd00:
; LINUX-64-STATIC: # %bb.0: # %entry
; LINUX-64-STATIC-NEXT: movl xsrc(,%rdi,4), %eax
; LINUX-64-STATIC-NEXT: movl %eax, xdst(,%rdi,4)
; LINUX-64-STATIC-NEXT: retq
;
; LINUX-32-STATIC-LABEL: ixd00:
; LINUX-32-STATIC: # %bb.0: # %entry
; LINUX-32-STATIC-NEXT: movl {{[0-9]+}}(%esp), %eax
; LINUX-32-STATIC-NEXT: movl xsrc(,%eax,4), %ecx
; LINUX-32-STATIC-NEXT: movl %ecx, xdst(,%eax,4)
; LINUX-32-STATIC-NEXT: retl
;
; LINUX-32-PIC-LABEL: ixd00:
; LINUX-32-PIC: # %bb.0: # %entry
; LINUX-32-PIC-NEXT: movl {{[0-9]+}}(%esp), %eax
; LINUX-32-PIC-NEXT: movl xsrc(,%eax,4), %ecx
; LINUX-32-PIC-NEXT: movl %ecx, xdst(,%eax,4)
; LINUX-32-PIC-NEXT: retl
;
; LINUX-64-PIC-LABEL: ixd00:
; LINUX-64-PIC: # %bb.0: # %entry
; LINUX-64-PIC-NEXT: movq xsrc@GOTPCREL(%rip), %rax
; LINUX-64-PIC-NEXT: movl (%rax,%rdi,4), %eax
; LINUX-64-PIC-NEXT: movq xdst@GOTPCREL(%rip), %rcx
; LINUX-64-PIC-NEXT: movl %eax, (%rcx,%rdi,4)
; LINUX-64-PIC-NEXT: retq
;
; DARWIN-32-STATIC-LABEL: ixd00:
; DARWIN-32-STATIC: ## %bb.0: ## %entry
; DARWIN-32-STATIC-NEXT: movl {{[0-9]+}}(%esp), %eax
; DARWIN-32-STATIC-NEXT: movl _xsrc(,%eax,4), %ecx
; DARWIN-32-STATIC-NEXT: movl %ecx, _xdst(,%eax,4)
; DARWIN-32-STATIC-NEXT: retl
;
; DARWIN-32-DYNAMIC-LABEL: ixd00:
; DARWIN-32-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-32-DYNAMIC-NEXT: movl {{[0-9]+}}(%esp), %eax
; DARWIN-32-DYNAMIC-NEXT: movl L_xsrc$non_lazy_ptr, %ecx
; DARWIN-32-DYNAMIC-NEXT: movl (%ecx,%eax,4), %ecx
; DARWIN-32-DYNAMIC-NEXT: movl L_xdst$non_lazy_ptr, %edx
; DARWIN-32-DYNAMIC-NEXT: movl %ecx, (%edx,%eax,4)
; DARWIN-32-DYNAMIC-NEXT: retl
;
; DARWIN-32-PIC-LABEL: ixd00:
; DARWIN-32-PIC: ## %bb.0: ## %entry
; DARWIN-32-PIC-NEXT: calll L25$pb
; DARWIN-32-PIC-NEXT: L25$pb:
; DARWIN-32-PIC-NEXT: popl %eax
; DARWIN-32-PIC-NEXT: movl {{[0-9]+}}(%esp), %ecx
; DARWIN-32-PIC-NEXT: movl L_xsrc$non_lazy_ptr-L25$pb(%eax), %edx
; DARWIN-32-PIC-NEXT: movl (%edx,%ecx,4), %edx
; DARWIN-32-PIC-NEXT: movl L_xdst$non_lazy_ptr-L25$pb(%eax), %eax
; DARWIN-32-PIC-NEXT: movl %edx, (%eax,%ecx,4)
; DARWIN-32-PIC-NEXT: retl
;
; DARWIN-64-STATIC-LABEL: ixd00:
; DARWIN-64-STATIC: ## %bb.0: ## %entry
; DARWIN-64-STATIC-NEXT: movq _xsrc@GOTPCREL(%rip), %rax
; DARWIN-64-STATIC-NEXT: movl (%rax,%rdi,4), %eax
; DARWIN-64-STATIC-NEXT: movq _xdst@GOTPCREL(%rip), %rcx
; DARWIN-64-STATIC-NEXT: movl %eax, (%rcx,%rdi,4)
; DARWIN-64-STATIC-NEXT: retq
;
; DARWIN-64-DYNAMIC-LABEL: ixd00:
; DARWIN-64-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-64-DYNAMIC-NEXT: movq _xsrc@GOTPCREL(%rip), %rax
; DARWIN-64-DYNAMIC-NEXT: movl (%rax,%rdi,4), %eax
; DARWIN-64-DYNAMIC-NEXT: movq _xdst@GOTPCREL(%rip), %rcx
; DARWIN-64-DYNAMIC-NEXT: movl %eax, (%rcx,%rdi,4)
; DARWIN-64-DYNAMIC-NEXT: retq
;
; DARWIN-64-PIC-LABEL: ixd00:
; DARWIN-64-PIC: ## %bb.0: ## %entry
; DARWIN-64-PIC-NEXT: movq _xsrc@GOTPCREL(%rip), %rax
; DARWIN-64-PIC-NEXT: movl (%rax,%rdi,4), %eax
; DARWIN-64-PIC-NEXT: movq _xdst@GOTPCREL(%rip), %rcx
; DARWIN-64-PIC-NEXT: movl %eax, (%rcx,%rdi,4)
; DARWIN-64-PIC-NEXT: retq
entry:
%0 = getelementptr [32 x i32], [32 x i32]* @xsrc, i64 0, i64 %i
%1 = load i32, i32* %0, align 4
%2 = getelementptr [32 x i32], [32 x i32]* @xdst, i64 0, i64 %i
store i32 %1, i32* %2, align 4
ret void
}
define void @ind01(i64 %i) nounwind {
; LINUX-64-STATIC-LABEL: ind01:
; LINUX-64-STATIC: # %bb.0: # %entry
; LINUX-64-STATIC-NEXT: leaq dst(,%rdi,4), %rax
; LINUX-64-STATIC-NEXT: movq %rax, ptr(%rip)
; LINUX-64-STATIC-NEXT: retq
;
; LINUX-32-STATIC-LABEL: ind01:
; LINUX-32-STATIC: # %bb.0: # %entry
; LINUX-32-STATIC-NEXT: movl {{[0-9]+}}(%esp), %eax
; LINUX-32-STATIC-NEXT: leal dst(,%eax,4), %eax
; LINUX-32-STATIC-NEXT: movl %eax, ptr
; LINUX-32-STATIC-NEXT: retl
;
; LINUX-32-PIC-LABEL: ind01:
; LINUX-32-PIC: # %bb.0: # %entry
; LINUX-32-PIC-NEXT: movl {{[0-9]+}}(%esp), %eax
; LINUX-32-PIC-NEXT: leal dst(,%eax,4), %eax
; LINUX-32-PIC-NEXT: movl %eax, ptr
; LINUX-32-PIC-NEXT: retl
;
; LINUX-64-PIC-LABEL: ind01:
; LINUX-64-PIC: # %bb.0: # %entry
; LINUX-64-PIC-NEXT: shlq $2, %rdi
; LINUX-64-PIC-NEXT: addq dst@GOTPCREL(%rip), %rdi
; LINUX-64-PIC-NEXT: movq ptr@GOTPCREL(%rip), %rax
; LINUX-64-PIC-NEXT: movq %rdi, (%rax)
; LINUX-64-PIC-NEXT: retq
;
; DARWIN-32-STATIC-LABEL: ind01:
; DARWIN-32-STATIC: ## %bb.0: ## %entry
; DARWIN-32-STATIC-NEXT: movl {{[0-9]+}}(%esp), %eax
; DARWIN-32-STATIC-NEXT: leal _dst(,%eax,4), %eax
; DARWIN-32-STATIC-NEXT: movl %eax, _ptr
; DARWIN-32-STATIC-NEXT: retl
;
; DARWIN-32-DYNAMIC-LABEL: ind01:
; DARWIN-32-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-32-DYNAMIC-NEXT: movl {{[0-9]+}}(%esp), %eax
; DARWIN-32-DYNAMIC-NEXT: shll $2, %eax
; DARWIN-32-DYNAMIC-NEXT: addl L_dst$non_lazy_ptr, %eax
; DARWIN-32-DYNAMIC-NEXT: movl L_ptr$non_lazy_ptr, %ecx
; DARWIN-32-DYNAMIC-NEXT: movl %eax, (%ecx)
; DARWIN-32-DYNAMIC-NEXT: retl
;
; DARWIN-32-PIC-LABEL: ind01:
; DARWIN-32-PIC: ## %bb.0: ## %entry
; DARWIN-32-PIC-NEXT: calll L26$pb
; DARWIN-32-PIC-NEXT: L26$pb:
; DARWIN-32-PIC-NEXT: popl %eax
; DARWIN-32-PIC-NEXT: movl {{[0-9]+}}(%esp), %ecx
; DARWIN-32-PIC-NEXT: shll $2, %ecx
; DARWIN-32-PIC-NEXT: addl L_dst$non_lazy_ptr-L26$pb(%eax), %ecx
; DARWIN-32-PIC-NEXT: movl L_ptr$non_lazy_ptr-L26$pb(%eax), %eax
; DARWIN-32-PIC-NEXT: movl %ecx, (%eax)
; DARWIN-32-PIC-NEXT: retl
;
; DARWIN-64-STATIC-LABEL: ind01:
; DARWIN-64-STATIC: ## %bb.0: ## %entry
; DARWIN-64-STATIC-NEXT: shlq $2, %rdi
; DARWIN-64-STATIC-NEXT: addq _dst@GOTPCREL(%rip), %rdi
; DARWIN-64-STATIC-NEXT: movq _ptr@GOTPCREL(%rip), %rax
; DARWIN-64-STATIC-NEXT: movq %rdi, (%rax)
; DARWIN-64-STATIC-NEXT: retq
;
; DARWIN-64-DYNAMIC-LABEL: ind01:
; DARWIN-64-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-64-DYNAMIC-NEXT: shlq $2, %rdi
; DARWIN-64-DYNAMIC-NEXT: addq _dst@GOTPCREL(%rip), %rdi
; DARWIN-64-DYNAMIC-NEXT: movq _ptr@GOTPCREL(%rip), %rax
; DARWIN-64-DYNAMIC-NEXT: movq %rdi, (%rax)
; DARWIN-64-DYNAMIC-NEXT: retq
;
; DARWIN-64-PIC-LABEL: ind01:
; DARWIN-64-PIC: ## %bb.0: ## %entry
; DARWIN-64-PIC-NEXT: shlq $2, %rdi
; DARWIN-64-PIC-NEXT: addq _dst@GOTPCREL(%rip), %rdi
; DARWIN-64-PIC-NEXT: movq _ptr@GOTPCREL(%rip), %rax
; DARWIN-64-PIC-NEXT: movq %rdi, (%rax)
; DARWIN-64-PIC-NEXT: retq
entry:
%0 = getelementptr [131072 x i32], [131072 x i32]* @dst, i64 0, i64 %i
store i32* %0, i32** @ptr, align 8
ret void
}
define void @ixd01(i64 %i) nounwind {
; LINUX-64-STATIC-LABEL: ixd01:
; LINUX-64-STATIC: # %bb.0: # %entry
; LINUX-64-STATIC-NEXT: leaq xdst(,%rdi,4), %rax
; LINUX-64-STATIC-NEXT: movq %rax, ptr(%rip)
; LINUX-64-STATIC-NEXT: retq
;
; LINUX-32-STATIC-LABEL: ixd01:
; LINUX-32-STATIC: # %bb.0: # %entry
; LINUX-32-STATIC-NEXT: movl {{[0-9]+}}(%esp), %eax
; LINUX-32-STATIC-NEXT: leal xdst(,%eax,4), %eax
; LINUX-32-STATIC-NEXT: movl %eax, ptr
; LINUX-32-STATIC-NEXT: retl
;
; LINUX-32-PIC-LABEL: ixd01:
; LINUX-32-PIC: # %bb.0: # %entry
; LINUX-32-PIC-NEXT: movl {{[0-9]+}}(%esp), %eax
; LINUX-32-PIC-NEXT: leal xdst(,%eax,4), %eax
; LINUX-32-PIC-NEXT: movl %eax, ptr
; LINUX-32-PIC-NEXT: retl
;
; LINUX-64-PIC-LABEL: ixd01:
; LINUX-64-PIC: # %bb.0: # %entry
; LINUX-64-PIC-NEXT: shlq $2, %rdi
; LINUX-64-PIC-NEXT: addq xdst@GOTPCREL(%rip), %rdi
; LINUX-64-PIC-NEXT: movq ptr@GOTPCREL(%rip), %rax
; LINUX-64-PIC-NEXT: movq %rdi, (%rax)
; LINUX-64-PIC-NEXT: retq
;
; DARWIN-32-STATIC-LABEL: ixd01:
; DARWIN-32-STATIC: ## %bb.0: ## %entry
; DARWIN-32-STATIC-NEXT: movl {{[0-9]+}}(%esp), %eax
; DARWIN-32-STATIC-NEXT: leal _xdst(,%eax,4), %eax
; DARWIN-32-STATIC-NEXT: movl %eax, _ptr
; DARWIN-32-STATIC-NEXT: retl
;
; DARWIN-32-DYNAMIC-LABEL: ixd01:
; DARWIN-32-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-32-DYNAMIC-NEXT: movl {{[0-9]+}}(%esp), %eax
; DARWIN-32-DYNAMIC-NEXT: shll $2, %eax
; DARWIN-32-DYNAMIC-NEXT: addl L_xdst$non_lazy_ptr, %eax
; DARWIN-32-DYNAMIC-NEXT: movl L_ptr$non_lazy_ptr, %ecx
; DARWIN-32-DYNAMIC-NEXT: movl %eax, (%ecx)
; DARWIN-32-DYNAMIC-NEXT: retl
;
; DARWIN-32-PIC-LABEL: ixd01:
; DARWIN-32-PIC: ## %bb.0: ## %entry
; DARWIN-32-PIC-NEXT: calll L27$pb
; DARWIN-32-PIC-NEXT: L27$pb:
; DARWIN-32-PIC-NEXT: popl %eax
; DARWIN-32-PIC-NEXT: movl {{[0-9]+}}(%esp), %ecx
; DARWIN-32-PIC-NEXT: shll $2, %ecx
; DARWIN-32-PIC-NEXT: addl L_xdst$non_lazy_ptr-L27$pb(%eax), %ecx
; DARWIN-32-PIC-NEXT: movl L_ptr$non_lazy_ptr-L27$pb(%eax), %eax
; DARWIN-32-PIC-NEXT: movl %ecx, (%eax)
; DARWIN-32-PIC-NEXT: retl
;
; DARWIN-64-STATIC-LABEL: ixd01:
; DARWIN-64-STATIC: ## %bb.0: ## %entry
; DARWIN-64-STATIC-NEXT: shlq $2, %rdi
; DARWIN-64-STATIC-NEXT: addq _xdst@GOTPCREL(%rip), %rdi
; DARWIN-64-STATIC-NEXT: movq _ptr@GOTPCREL(%rip), %rax
; DARWIN-64-STATIC-NEXT: movq %rdi, (%rax)
; DARWIN-64-STATIC-NEXT: retq
;
; DARWIN-64-DYNAMIC-LABEL: ixd01:
; DARWIN-64-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-64-DYNAMIC-NEXT: shlq $2, %rdi
; DARWIN-64-DYNAMIC-NEXT: addq _xdst@GOTPCREL(%rip), %rdi
; DARWIN-64-DYNAMIC-NEXT: movq _ptr@GOTPCREL(%rip), %rax
; DARWIN-64-DYNAMIC-NEXT: movq %rdi, (%rax)
; DARWIN-64-DYNAMIC-NEXT: retq
;
; DARWIN-64-PIC-LABEL: ixd01:
; DARWIN-64-PIC: ## %bb.0: ## %entry
; DARWIN-64-PIC-NEXT: shlq $2, %rdi
; DARWIN-64-PIC-NEXT: addq _xdst@GOTPCREL(%rip), %rdi
; DARWIN-64-PIC-NEXT: movq _ptr@GOTPCREL(%rip), %rax
; DARWIN-64-PIC-NEXT: movq %rdi, (%rax)
; DARWIN-64-PIC-NEXT: retq
entry:
%0 = getelementptr [32 x i32], [32 x i32]* @xdst, i64 0, i64 %i
store i32* %0, i32** @ptr, align 8
ret void
}
define void @ind02(i64 %i) nounwind {
; LINUX-64-STATIC-LABEL: ind02:
; LINUX-64-STATIC: # %bb.0: # %entry
; LINUX-64-STATIC-NEXT: movl src(,%rdi,4), %eax
; LINUX-64-STATIC-NEXT: movq ptr(%rip), %rcx
; LINUX-64-STATIC-NEXT: movl %eax, (%rcx,%rdi,4)
; LINUX-64-STATIC-NEXT: retq
;
; LINUX-32-STATIC-LABEL: ind02:
; LINUX-32-STATIC: # %bb.0: # %entry
; LINUX-32-STATIC-NEXT: movl {{[0-9]+}}(%esp), %eax
; LINUX-32-STATIC-NEXT: movl src(,%eax,4), %ecx
; LINUX-32-STATIC-NEXT: movl ptr, %edx
; LINUX-32-STATIC-NEXT: movl %ecx, (%edx,%eax,4)
; LINUX-32-STATIC-NEXT: retl
;
; LINUX-32-PIC-LABEL: ind02:
; LINUX-32-PIC: # %bb.0: # %entry
; LINUX-32-PIC-NEXT: movl {{[0-9]+}}(%esp), %eax
; LINUX-32-PIC-NEXT: movl src(,%eax,4), %ecx
; LINUX-32-PIC-NEXT: movl ptr, %edx
; LINUX-32-PIC-NEXT: movl %ecx, (%edx,%eax,4)
; LINUX-32-PIC-NEXT: retl
;
; LINUX-64-PIC-LABEL: ind02:
; LINUX-64-PIC: # %bb.0: # %entry
; LINUX-64-PIC-NEXT: movq src@GOTPCREL(%rip), %rax
; LINUX-64-PIC-NEXT: movl (%rax,%rdi,4), %eax
; LINUX-64-PIC-NEXT: movq ptr@GOTPCREL(%rip), %rcx
; LINUX-64-PIC-NEXT: movq (%rcx), %rcx
; LINUX-64-PIC-NEXT: movl %eax, (%rcx,%rdi,4)
; LINUX-64-PIC-NEXT: retq
;
; DARWIN-32-STATIC-LABEL: ind02:
; DARWIN-32-STATIC: ## %bb.0: ## %entry
; DARWIN-32-STATIC-NEXT: movl {{[0-9]+}}(%esp), %eax
; DARWIN-32-STATIC-NEXT: movl _src(,%eax,4), %ecx
; DARWIN-32-STATIC-NEXT: movl _ptr, %edx
; DARWIN-32-STATIC-NEXT: movl %ecx, (%edx,%eax,4)
; DARWIN-32-STATIC-NEXT: retl
;
; DARWIN-32-DYNAMIC-LABEL: ind02:
; DARWIN-32-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-32-DYNAMIC-NEXT: movl {{[0-9]+}}(%esp), %eax
; DARWIN-32-DYNAMIC-NEXT: movl L_src$non_lazy_ptr, %ecx
; DARWIN-32-DYNAMIC-NEXT: movl (%ecx,%eax,4), %ecx
; DARWIN-32-DYNAMIC-NEXT: movl L_ptr$non_lazy_ptr, %edx
; DARWIN-32-DYNAMIC-NEXT: movl (%edx), %edx
; DARWIN-32-DYNAMIC-NEXT: movl %ecx, (%edx,%eax,4)
; DARWIN-32-DYNAMIC-NEXT: retl
;
; DARWIN-32-PIC-LABEL: ind02:
; DARWIN-32-PIC: ## %bb.0: ## %entry
; DARWIN-32-PIC-NEXT: calll L28$pb
; DARWIN-32-PIC-NEXT: L28$pb:
; DARWIN-32-PIC-NEXT: popl %eax
; DARWIN-32-PIC-NEXT: movl {{[0-9]+}}(%esp), %ecx
; DARWIN-32-PIC-NEXT: movl L_src$non_lazy_ptr-L28$pb(%eax), %edx
; DARWIN-32-PIC-NEXT: movl (%edx,%ecx,4), %edx
; DARWIN-32-PIC-NEXT: movl L_ptr$non_lazy_ptr-L28$pb(%eax), %eax
; DARWIN-32-PIC-NEXT: movl (%eax), %eax
; DARWIN-32-PIC-NEXT: movl %edx, (%eax,%ecx,4)
; DARWIN-32-PIC-NEXT: retl
;
; DARWIN-64-STATIC-LABEL: ind02:
; DARWIN-64-STATIC: ## %bb.0: ## %entry
; DARWIN-64-STATIC-NEXT: movq _src@GOTPCREL(%rip), %rax
; DARWIN-64-STATIC-NEXT: movl (%rax,%rdi,4), %eax
; DARWIN-64-STATIC-NEXT: movq _ptr@GOTPCREL(%rip), %rcx
; DARWIN-64-STATIC-NEXT: movq (%rcx), %rcx
; DARWIN-64-STATIC-NEXT: movl %eax, (%rcx,%rdi,4)
; DARWIN-64-STATIC-NEXT: retq
;
; DARWIN-64-DYNAMIC-LABEL: ind02:
; DARWIN-64-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-64-DYNAMIC-NEXT: movq _src@GOTPCREL(%rip), %rax
; DARWIN-64-DYNAMIC-NEXT: movl (%rax,%rdi,4), %eax
; DARWIN-64-DYNAMIC-NEXT: movq _ptr@GOTPCREL(%rip), %rcx
; DARWIN-64-DYNAMIC-NEXT: movq (%rcx), %rcx
; DARWIN-64-DYNAMIC-NEXT: movl %eax, (%rcx,%rdi,4)
; DARWIN-64-DYNAMIC-NEXT: retq
;
; DARWIN-64-PIC-LABEL: ind02:
; DARWIN-64-PIC: ## %bb.0: ## %entry
; DARWIN-64-PIC-NEXT: movq _src@GOTPCREL(%rip), %rax
; DARWIN-64-PIC-NEXT: movl (%rax,%rdi,4), %eax
; DARWIN-64-PIC-NEXT: movq _ptr@GOTPCREL(%rip), %rcx
; DARWIN-64-PIC-NEXT: movq (%rcx), %rcx
; DARWIN-64-PIC-NEXT: movl %eax, (%rcx,%rdi,4)
; DARWIN-64-PIC-NEXT: retq
entry:
%0 = load i32*, i32** @ptr, align 8
%1 = getelementptr [131072 x i32], [131072 x i32]* @src, i64 0, i64 %i
%2 = load i32, i32* %1, align 4
%3 = getelementptr i32, i32* %0, i64 %i
store i32 %2, i32* %3, align 4
ret void
}
define void @ixd02(i64 %i) nounwind {
; LINUX-64-STATIC-LABEL: ixd02:
; LINUX-64-STATIC: # %bb.0: # %entry
; LINUX-64-STATIC-NEXT: movl xsrc(,%rdi,4), %eax
; LINUX-64-STATIC-NEXT: movq ptr(%rip), %rcx
; LINUX-64-STATIC-NEXT: movl %eax, (%rcx,%rdi,4)
; LINUX-64-STATIC-NEXT: retq
;
; LINUX-32-STATIC-LABEL: ixd02:
; LINUX-32-STATIC: # %bb.0: # %entry
; LINUX-32-STATIC-NEXT: movl {{[0-9]+}}(%esp), %eax
; LINUX-32-STATIC-NEXT: movl xsrc(,%eax,4), %ecx
; LINUX-32-STATIC-NEXT: movl ptr, %edx
; LINUX-32-STATIC-NEXT: movl %ecx, (%edx,%eax,4)
; LINUX-32-STATIC-NEXT: retl
;
; LINUX-32-PIC-LABEL: ixd02:
; LINUX-32-PIC: # %bb.0: # %entry
; LINUX-32-PIC-NEXT: movl {{[0-9]+}}(%esp), %eax
; LINUX-32-PIC-NEXT: movl xsrc(,%eax,4), %ecx
; LINUX-32-PIC-NEXT: movl ptr, %edx
; LINUX-32-PIC-NEXT: movl %ecx, (%edx,%eax,4)
; LINUX-32-PIC-NEXT: retl
;
; LINUX-64-PIC-LABEL: ixd02:
; LINUX-64-PIC: # %bb.0: # %entry
; LINUX-64-PIC-NEXT: movq xsrc@GOTPCREL(%rip), %rax
; LINUX-64-PIC-NEXT: movl (%rax,%rdi,4), %eax
; LINUX-64-PIC-NEXT: movq ptr@GOTPCREL(%rip), %rcx
; LINUX-64-PIC-NEXT: movq (%rcx), %rcx
; LINUX-64-PIC-NEXT: movl %eax, (%rcx,%rdi,4)
; LINUX-64-PIC-NEXT: retq
;
; DARWIN-32-STATIC-LABEL: ixd02:
; DARWIN-32-STATIC: ## %bb.0: ## %entry
; DARWIN-32-STATIC-NEXT: movl {{[0-9]+}}(%esp), %eax
; DARWIN-32-STATIC-NEXT: movl _xsrc(,%eax,4), %ecx
; DARWIN-32-STATIC-NEXT: movl _ptr, %edx
; DARWIN-32-STATIC-NEXT: movl %ecx, (%edx,%eax,4)
; DARWIN-32-STATIC-NEXT: retl
;
; DARWIN-32-DYNAMIC-LABEL: ixd02:
; DARWIN-32-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-32-DYNAMIC-NEXT: movl {{[0-9]+}}(%esp), %eax
; DARWIN-32-DYNAMIC-NEXT: movl L_xsrc$non_lazy_ptr, %ecx
; DARWIN-32-DYNAMIC-NEXT: movl (%ecx,%eax,4), %ecx
; DARWIN-32-DYNAMIC-NEXT: movl L_ptr$non_lazy_ptr, %edx
; DARWIN-32-DYNAMIC-NEXT: movl (%edx), %edx
; DARWIN-32-DYNAMIC-NEXT: movl %ecx, (%edx,%eax,4)
; DARWIN-32-DYNAMIC-NEXT: retl
;
; DARWIN-32-PIC-LABEL: ixd02:
; DARWIN-32-PIC: ## %bb.0: ## %entry
; DARWIN-32-PIC-NEXT: calll L29$pb
; DARWIN-32-PIC-NEXT: L29$pb:
; DARWIN-32-PIC-NEXT: popl %eax
; DARWIN-32-PIC-NEXT: movl {{[0-9]+}}(%esp), %ecx
; DARWIN-32-PIC-NEXT: movl L_xsrc$non_lazy_ptr-L29$pb(%eax), %edx
; DARWIN-32-PIC-NEXT: movl (%edx,%ecx,4), %edx
; DARWIN-32-PIC-NEXT: movl L_ptr$non_lazy_ptr-L29$pb(%eax), %eax
; DARWIN-32-PIC-NEXT: movl (%eax), %eax
; DARWIN-32-PIC-NEXT: movl %edx, (%eax,%ecx,4)
; DARWIN-32-PIC-NEXT: retl
;
; DARWIN-64-STATIC-LABEL: ixd02:
; DARWIN-64-STATIC: ## %bb.0: ## %entry
; DARWIN-64-STATIC-NEXT: movq _xsrc@GOTPCREL(%rip), %rax
; DARWIN-64-STATIC-NEXT: movl (%rax,%rdi,4), %eax
; DARWIN-64-STATIC-NEXT: movq _ptr@GOTPCREL(%rip), %rcx
; DARWIN-64-STATIC-NEXT: movq (%rcx), %rcx
; DARWIN-64-STATIC-NEXT: movl %eax, (%rcx,%rdi,4)
; DARWIN-64-STATIC-NEXT: retq
;
; DARWIN-64-DYNAMIC-LABEL: ixd02:
; DARWIN-64-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-64-DYNAMIC-NEXT: movq _xsrc@GOTPCREL(%rip), %rax
; DARWIN-64-DYNAMIC-NEXT: movl (%rax,%rdi,4), %eax
; DARWIN-64-DYNAMIC-NEXT: movq _ptr@GOTPCREL(%rip), %rcx
; DARWIN-64-DYNAMIC-NEXT: movq (%rcx), %rcx
; DARWIN-64-DYNAMIC-NEXT: movl %eax, (%rcx,%rdi,4)
; DARWIN-64-DYNAMIC-NEXT: retq
;
; DARWIN-64-PIC-LABEL: ixd02:
; DARWIN-64-PIC: ## %bb.0: ## %entry
; DARWIN-64-PIC-NEXT: movq _xsrc@GOTPCREL(%rip), %rax
; DARWIN-64-PIC-NEXT: movl (%rax,%rdi,4), %eax
; DARWIN-64-PIC-NEXT: movq _ptr@GOTPCREL(%rip), %rcx
; DARWIN-64-PIC-NEXT: movq (%rcx), %rcx
; DARWIN-64-PIC-NEXT: movl %eax, (%rcx,%rdi,4)
; DARWIN-64-PIC-NEXT: retq
entry:
%0 = load i32*, i32** @ptr, align 8
%1 = getelementptr [32 x i32], [32 x i32]* @xsrc, i64 0, i64 %i
%2 = load i32, i32* %1, align 4
%3 = getelementptr i32, i32* %0, i64 %i
store i32 %2, i32* %3, align 4
ret void
}
define void @ind03(i64 %i) nounwind {
; LINUX-64-STATIC-LABEL: ind03:
; LINUX-64-STATIC: # %bb.0: # %entry
; LINUX-64-STATIC-NEXT: movl dsrc(,%rdi,4), %eax
; LINUX-64-STATIC-NEXT: movl %eax, ddst(,%rdi,4)
; LINUX-64-STATIC-NEXT: retq
;
; LINUX-32-STATIC-LABEL: ind03:
; LINUX-32-STATIC: # %bb.0: # %entry
; LINUX-32-STATIC-NEXT: movl {{[0-9]+}}(%esp), %eax
; LINUX-32-STATIC-NEXT: movl dsrc(,%eax,4), %ecx
; LINUX-32-STATIC-NEXT: movl %ecx, ddst(,%eax,4)
; LINUX-32-STATIC-NEXT: retl
;
; LINUX-32-PIC-LABEL: ind03:
; LINUX-32-PIC: # %bb.0: # %entry
; LINUX-32-PIC-NEXT: movl {{[0-9]+}}(%esp), %eax
; LINUX-32-PIC-NEXT: movl dsrc(,%eax,4), %ecx
; LINUX-32-PIC-NEXT: movl %ecx, ddst(,%eax,4)
; LINUX-32-PIC-NEXT: retl
;
; LINUX-64-PIC-LABEL: ind03:
; LINUX-64-PIC: # %bb.0: # %entry
; LINUX-64-PIC-NEXT: movq dsrc@GOTPCREL(%rip), %rax
; LINUX-64-PIC-NEXT: movl (%rax,%rdi,4), %eax
; LINUX-64-PIC-NEXT: movq ddst@GOTPCREL(%rip), %rcx
; LINUX-64-PIC-NEXT: movl %eax, (%rcx,%rdi,4)
; LINUX-64-PIC-NEXT: retq
;
; DARWIN-32-STATIC-LABEL: ind03:
; DARWIN-32-STATIC: ## %bb.0: ## %entry
; DARWIN-32-STATIC-NEXT: movl {{[0-9]+}}(%esp), %eax
; DARWIN-32-STATIC-NEXT: movl _dsrc(,%eax,4), %ecx
; DARWIN-32-STATIC-NEXT: movl %ecx, _ddst(,%eax,4)
; DARWIN-32-STATIC-NEXT: retl
;
; DARWIN-32-DYNAMIC-LABEL: ind03:
; DARWIN-32-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-32-DYNAMIC-NEXT: movl {{[0-9]+}}(%esp), %eax
; DARWIN-32-DYNAMIC-NEXT: movl _dsrc(,%eax,4), %ecx
; DARWIN-32-DYNAMIC-NEXT: movl %ecx, _ddst(,%eax,4)
; DARWIN-32-DYNAMIC-NEXT: retl
;
; DARWIN-32-PIC-LABEL: ind03:
; DARWIN-32-PIC: ## %bb.0: ## %entry
; DARWIN-32-PIC-NEXT: calll L30$pb
; DARWIN-32-PIC-NEXT: L30$pb:
; DARWIN-32-PIC-NEXT: popl %eax
; DARWIN-32-PIC-NEXT: movl {{[0-9]+}}(%esp), %ecx
; DARWIN-32-PIC-NEXT: movl _dsrc-L30$pb(%eax,%ecx,4), %edx
; DARWIN-32-PIC-NEXT: movl %edx, _ddst-L30$pb(%eax,%ecx,4)
; DARWIN-32-PIC-NEXT: retl
;
; DARWIN-64-STATIC-LABEL: ind03:
; DARWIN-64-STATIC: ## %bb.0: ## %entry
; DARWIN-64-STATIC-NEXT: leaq _dsrc(%rip), %rax
; DARWIN-64-STATIC-NEXT: movl (%rax,%rdi,4), %eax
; DARWIN-64-STATIC-NEXT: leaq _ddst(%rip), %rcx
; DARWIN-64-STATIC-NEXT: movl %eax, (%rcx,%rdi,4)
; DARWIN-64-STATIC-NEXT: retq
;
; DARWIN-64-DYNAMIC-LABEL: ind03:
; DARWIN-64-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-64-DYNAMIC-NEXT: leaq _dsrc(%rip), %rax
; DARWIN-64-DYNAMIC-NEXT: movl (%rax,%rdi,4), %eax
; DARWIN-64-DYNAMIC-NEXT: leaq _ddst(%rip), %rcx
; DARWIN-64-DYNAMIC-NEXT: movl %eax, (%rcx,%rdi,4)
; DARWIN-64-DYNAMIC-NEXT: retq
;
; DARWIN-64-PIC-LABEL: ind03:
; DARWIN-64-PIC: ## %bb.0: ## %entry
; DARWIN-64-PIC-NEXT: leaq _dsrc(%rip), %rax
; DARWIN-64-PIC-NEXT: movl (%rax,%rdi,4), %eax
; DARWIN-64-PIC-NEXT: leaq _ddst(%rip), %rcx
; DARWIN-64-PIC-NEXT: movl %eax, (%rcx,%rdi,4)
; DARWIN-64-PIC-NEXT: retq
entry:
%0 = getelementptr [131072 x i32], [131072 x i32]* @dsrc, i64 0, i64 %i
%1 = load i32, i32* %0, align 4
%2 = getelementptr [131072 x i32], [131072 x i32]* @ddst, i64 0, i64 %i
store i32 %1, i32* %2, align 4
ret void
}
define void @ind04(i64 %i) nounwind {
; LINUX-64-STATIC-LABEL: ind04:
; LINUX-64-STATIC: # %bb.0: # %entry
; LINUX-64-STATIC-NEXT: leaq ddst(,%rdi,4), %rax
; LINUX-64-STATIC-NEXT: movq %rax, dptr(%rip)
; LINUX-64-STATIC-NEXT: retq
;
; LINUX-32-STATIC-LABEL: ind04:
; LINUX-32-STATIC: # %bb.0: # %entry
; LINUX-32-STATIC-NEXT: movl {{[0-9]+}}(%esp), %eax
; LINUX-32-STATIC-NEXT: leal ddst(,%eax,4), %eax
; LINUX-32-STATIC-NEXT: movl %eax, dptr
; LINUX-32-STATIC-NEXT: retl
;
; LINUX-32-PIC-LABEL: ind04:
; LINUX-32-PIC: # %bb.0: # %entry
; LINUX-32-PIC-NEXT: movl {{[0-9]+}}(%esp), %eax
; LINUX-32-PIC-NEXT: leal ddst(,%eax,4), %eax
; LINUX-32-PIC-NEXT: movl %eax, dptr
; LINUX-32-PIC-NEXT: retl
;
; LINUX-64-PIC-LABEL: ind04:
; LINUX-64-PIC: # %bb.0: # %entry
; LINUX-64-PIC-NEXT: shlq $2, %rdi
; LINUX-64-PIC-NEXT: addq ddst@GOTPCREL(%rip), %rdi
; LINUX-64-PIC-NEXT: movq dptr@GOTPCREL(%rip), %rax
; LINUX-64-PIC-NEXT: movq %rdi, (%rax)
; LINUX-64-PIC-NEXT: retq
;
; DARWIN-32-STATIC-LABEL: ind04:
; DARWIN-32-STATIC: ## %bb.0: ## %entry
; DARWIN-32-STATIC-NEXT: movl {{[0-9]+}}(%esp), %eax
; DARWIN-32-STATIC-NEXT: leal _ddst(,%eax,4), %eax
; DARWIN-32-STATIC-NEXT: movl %eax, _dptr
; DARWIN-32-STATIC-NEXT: retl
;
; DARWIN-32-DYNAMIC-LABEL: ind04:
; DARWIN-32-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-32-DYNAMIC-NEXT: movl {{[0-9]+}}(%esp), %eax
; DARWIN-32-DYNAMIC-NEXT: leal _ddst(,%eax,4), %eax
; DARWIN-32-DYNAMIC-NEXT: movl %eax, _dptr
; DARWIN-32-DYNAMIC-NEXT: retl
;
; DARWIN-32-PIC-LABEL: ind04:
; DARWIN-32-PIC: ## %bb.0: ## %entry
; DARWIN-32-PIC-NEXT: calll L31$pb
; DARWIN-32-PIC-NEXT: L31$pb:
; DARWIN-32-PIC-NEXT: popl %eax
; DARWIN-32-PIC-NEXT: movl {{[0-9]+}}(%esp), %ecx
; DARWIN-32-PIC-NEXT: leal _ddst-L31$pb(%eax,%ecx,4), %ecx
; DARWIN-32-PIC-NEXT: movl %ecx, _dptr-L31$pb(%eax)
; DARWIN-32-PIC-NEXT: retl
;
; DARWIN-64-STATIC-LABEL: ind04:
; DARWIN-64-STATIC: ## %bb.0: ## %entry
; DARWIN-64-STATIC-NEXT: leaq _ddst(%rip), %rax
; DARWIN-64-STATIC-NEXT: leaq (%rax,%rdi,4), %rax
; DARWIN-64-STATIC-NEXT: movq %rax, _dptr(%rip)
; DARWIN-64-STATIC-NEXT: retq
;
; DARWIN-64-DYNAMIC-LABEL: ind04:
; DARWIN-64-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-64-DYNAMIC-NEXT: leaq _ddst(%rip), %rax
; DARWIN-64-DYNAMIC-NEXT: leaq (%rax,%rdi,4), %rax
; DARWIN-64-DYNAMIC-NEXT: movq %rax, _dptr(%rip)
; DARWIN-64-DYNAMIC-NEXT: retq
;
; DARWIN-64-PIC-LABEL: ind04:
; DARWIN-64-PIC: ## %bb.0: ## %entry
; DARWIN-64-PIC-NEXT: leaq _ddst(%rip), %rax
; DARWIN-64-PIC-NEXT: leaq (%rax,%rdi,4), %rax
; DARWIN-64-PIC-NEXT: movq %rax, _dptr(%rip)
; DARWIN-64-PIC-NEXT: retq
entry:
%0 = getelementptr [131072 x i32], [131072 x i32]* @ddst, i64 0, i64 %i
store i32* %0, i32** @dptr, align 8
ret void
}
define void @ind05(i64 %i) nounwind {
; LINUX-64-STATIC-LABEL: ind05:
; LINUX-64-STATIC: # %bb.0: # %entry
; LINUX-64-STATIC-NEXT: movl dsrc(,%rdi,4), %eax
; LINUX-64-STATIC-NEXT: movq dptr(%rip), %rcx
; LINUX-64-STATIC-NEXT: movl %eax, (%rcx,%rdi,4)
; LINUX-64-STATIC-NEXT: retq
;
; LINUX-32-STATIC-LABEL: ind05:
; LINUX-32-STATIC: # %bb.0: # %entry
; LINUX-32-STATIC-NEXT: movl {{[0-9]+}}(%esp), %eax
; LINUX-32-STATIC-NEXT: movl dsrc(,%eax,4), %ecx
; LINUX-32-STATIC-NEXT: movl dptr, %edx
; LINUX-32-STATIC-NEXT: movl %ecx, (%edx,%eax,4)
; LINUX-32-STATIC-NEXT: retl
;
; LINUX-32-PIC-LABEL: ind05:
; LINUX-32-PIC: # %bb.0: # %entry
; LINUX-32-PIC-NEXT: movl {{[0-9]+}}(%esp), %eax
; LINUX-32-PIC-NEXT: movl dsrc(,%eax,4), %ecx
; LINUX-32-PIC-NEXT: movl dptr, %edx
; LINUX-32-PIC-NEXT: movl %ecx, (%edx,%eax,4)
; LINUX-32-PIC-NEXT: retl
;
; LINUX-64-PIC-LABEL: ind05:
; LINUX-64-PIC: # %bb.0: # %entry
; LINUX-64-PIC-NEXT: movq dsrc@GOTPCREL(%rip), %rax
; LINUX-64-PIC-NEXT: movl (%rax,%rdi,4), %eax
; LINUX-64-PIC-NEXT: movq dptr@GOTPCREL(%rip), %rcx
; LINUX-64-PIC-NEXT: movq (%rcx), %rcx
; LINUX-64-PIC-NEXT: movl %eax, (%rcx,%rdi,4)
; LINUX-64-PIC-NEXT: retq
;
; DARWIN-32-STATIC-LABEL: ind05:
; DARWIN-32-STATIC: ## %bb.0: ## %entry
; DARWIN-32-STATIC-NEXT: movl {{[0-9]+}}(%esp), %eax
; DARWIN-32-STATIC-NEXT: movl _dsrc(,%eax,4), %ecx
; DARWIN-32-STATIC-NEXT: movl _dptr, %edx
; DARWIN-32-STATIC-NEXT: movl %ecx, (%edx,%eax,4)
; DARWIN-32-STATIC-NEXT: retl
;
; DARWIN-32-DYNAMIC-LABEL: ind05:
; DARWIN-32-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-32-DYNAMIC-NEXT: movl {{[0-9]+}}(%esp), %eax
; DARWIN-32-DYNAMIC-NEXT: movl _dsrc(,%eax,4), %ecx
; DARWIN-32-DYNAMIC-NEXT: movl _dptr, %edx
; DARWIN-32-DYNAMIC-NEXT: movl %ecx, (%edx,%eax,4)
; DARWIN-32-DYNAMIC-NEXT: retl
;
; DARWIN-32-PIC-LABEL: ind05:
; DARWIN-32-PIC: ## %bb.0: ## %entry
; DARWIN-32-PIC-NEXT: calll L32$pb
; DARWIN-32-PIC-NEXT: L32$pb:
; DARWIN-32-PIC-NEXT: popl %eax
; DARWIN-32-PIC-NEXT: movl {{[0-9]+}}(%esp), %ecx
; DARWIN-32-PIC-NEXT: movl _dsrc-L32$pb(%eax,%ecx,4), %edx
; DARWIN-32-PIC-NEXT: movl _dptr-L32$pb(%eax), %eax
; DARWIN-32-PIC-NEXT: movl %edx, (%eax,%ecx,4)
; DARWIN-32-PIC-NEXT: retl
;
; DARWIN-64-STATIC-LABEL: ind05:
; DARWIN-64-STATIC: ## %bb.0: ## %entry
; DARWIN-64-STATIC-NEXT: leaq _dsrc(%rip), %rax
; DARWIN-64-STATIC-NEXT: movl (%rax,%rdi,4), %eax
; DARWIN-64-STATIC-NEXT: movq _dptr(%rip), %rcx
; DARWIN-64-STATIC-NEXT: movl %eax, (%rcx,%rdi,4)
; DARWIN-64-STATIC-NEXT: retq
;
; DARWIN-64-DYNAMIC-LABEL: ind05:
; DARWIN-64-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-64-DYNAMIC-NEXT: leaq _dsrc(%rip), %rax
; DARWIN-64-DYNAMIC-NEXT: movl (%rax,%rdi,4), %eax
; DARWIN-64-DYNAMIC-NEXT: movq _dptr(%rip), %rcx
; DARWIN-64-DYNAMIC-NEXT: movl %eax, (%rcx,%rdi,4)
; DARWIN-64-DYNAMIC-NEXT: retq
;
; DARWIN-64-PIC-LABEL: ind05:
; DARWIN-64-PIC: ## %bb.0: ## %entry
; DARWIN-64-PIC-NEXT: leaq _dsrc(%rip), %rax
; DARWIN-64-PIC-NEXT: movl (%rax,%rdi,4), %eax
; DARWIN-64-PIC-NEXT: movq _dptr(%rip), %rcx
; DARWIN-64-PIC-NEXT: movl %eax, (%rcx,%rdi,4)
; DARWIN-64-PIC-NEXT: retq
entry:
%0 = load i32*, i32** @dptr, align 8
%1 = getelementptr [131072 x i32], [131072 x i32]* @dsrc, i64 0, i64 %i
%2 = load i32, i32* %1, align 4
%3 = getelementptr i32, i32* %0, i64 %i
store i32 %2, i32* %3, align 4
ret void
}
define void @ind06(i64 %i) nounwind {
; LINUX-64-STATIC-LABEL: ind06:
; LINUX-64-STATIC: # %bb.0: # %entry
; LINUX-64-STATIC-NEXT: movl lsrc(,%rdi,4), %eax
; LINUX-64-STATIC-NEXT: movl %eax, ldst(,%rdi,4)
; LINUX-64-STATIC-NEXT: retq
;
; LINUX-32-STATIC-LABEL: ind06:
; LINUX-32-STATIC: # %bb.0: # %entry
; LINUX-32-STATIC-NEXT: movl {{[0-9]+}}(%esp), %eax
; LINUX-32-STATIC-NEXT: movl lsrc(,%eax,4), %ecx
; LINUX-32-STATIC-NEXT: movl %ecx, ldst(,%eax,4)
; LINUX-32-STATIC-NEXT: retl
;
; LINUX-32-PIC-LABEL: ind06:
; LINUX-32-PIC: # %bb.0: # %entry
; LINUX-32-PIC-NEXT: movl {{[0-9]+}}(%esp), %eax
; LINUX-32-PIC-NEXT: movl lsrc(,%eax,4), %ecx
; LINUX-32-PIC-NEXT: movl %ecx, ldst(,%eax,4)
; LINUX-32-PIC-NEXT: retl
;
; LINUX-64-PIC-LABEL: ind06:
; LINUX-64-PIC: # %bb.0: # %entry
; LINUX-64-PIC-NEXT: leaq lsrc(%rip), %rax
; LINUX-64-PIC-NEXT: movl (%rax,%rdi,4), %eax
; LINUX-64-PIC-NEXT: leaq ldst(%rip), %rcx
; LINUX-64-PIC-NEXT: movl %eax, (%rcx,%rdi,4)
; LINUX-64-PIC-NEXT: retq
;
; DARWIN-32-STATIC-LABEL: ind06:
; DARWIN-32-STATIC: ## %bb.0: ## %entry
; DARWIN-32-STATIC-NEXT: movl {{[0-9]+}}(%esp), %eax
; DARWIN-32-STATIC-NEXT: movl _lsrc(,%eax,4), %ecx
; DARWIN-32-STATIC-NEXT: movl %ecx, _ldst(,%eax,4)
; DARWIN-32-STATIC-NEXT: retl
;
; DARWIN-32-DYNAMIC-LABEL: ind06:
; DARWIN-32-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-32-DYNAMIC-NEXT: movl {{[0-9]+}}(%esp), %eax
; DARWIN-32-DYNAMIC-NEXT: movl _lsrc(,%eax,4), %ecx
; DARWIN-32-DYNAMIC-NEXT: movl %ecx, _ldst(,%eax,4)
; DARWIN-32-DYNAMIC-NEXT: retl
;
; DARWIN-32-PIC-LABEL: ind06:
; DARWIN-32-PIC: ## %bb.0: ## %entry
; DARWIN-32-PIC-NEXT: calll L33$pb
; DARWIN-32-PIC-NEXT: L33$pb:
; DARWIN-32-PIC-NEXT: popl %eax
; DARWIN-32-PIC-NEXT: movl {{[0-9]+}}(%esp), %ecx
; DARWIN-32-PIC-NEXT: movl _lsrc-L33$pb(%eax,%ecx,4), %edx
; DARWIN-32-PIC-NEXT: movl %edx, _ldst-L33$pb(%eax,%ecx,4)
; DARWIN-32-PIC-NEXT: retl
;
; DARWIN-64-STATIC-LABEL: ind06:
; DARWIN-64-STATIC: ## %bb.0: ## %entry
; DARWIN-64-STATIC-NEXT: leaq _lsrc(%rip), %rax
; DARWIN-64-STATIC-NEXT: movl (%rax,%rdi,4), %eax
; DARWIN-64-STATIC-NEXT: leaq _ldst(%rip), %rcx
; DARWIN-64-STATIC-NEXT: movl %eax, (%rcx,%rdi,4)
; DARWIN-64-STATIC-NEXT: retq
;
; DARWIN-64-DYNAMIC-LABEL: ind06:
; DARWIN-64-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-64-DYNAMIC-NEXT: leaq _lsrc(%rip), %rax
; DARWIN-64-DYNAMIC-NEXT: movl (%rax,%rdi,4), %eax
; DARWIN-64-DYNAMIC-NEXT: leaq _ldst(%rip), %rcx
; DARWIN-64-DYNAMIC-NEXT: movl %eax, (%rcx,%rdi,4)
; DARWIN-64-DYNAMIC-NEXT: retq
;
; DARWIN-64-PIC-LABEL: ind06:
; DARWIN-64-PIC: ## %bb.0: ## %entry
; DARWIN-64-PIC-NEXT: leaq _lsrc(%rip), %rax
; DARWIN-64-PIC-NEXT: movl (%rax,%rdi,4), %eax
; DARWIN-64-PIC-NEXT: leaq _ldst(%rip), %rcx
; DARWIN-64-PIC-NEXT: movl %eax, (%rcx,%rdi,4)
; DARWIN-64-PIC-NEXT: retq
entry:
%0 = getelementptr [131072 x i32], [131072 x i32]* @lsrc, i64 0, i64 %i
%1 = load i32, i32* %0, align 4
%2 = getelementptr [131072 x i32], [131072 x i32]* @ldst, i64 0, i64 %i
store i32 %1, i32* %2, align 4
ret void
}
define void @ind07(i64 %i) nounwind {
; LINUX-64-STATIC-LABEL: ind07:
; LINUX-64-STATIC: # %bb.0: # %entry
; LINUX-64-STATIC-NEXT: leaq ldst(,%rdi,4), %rax
; LINUX-64-STATIC-NEXT: movq %rax, lptr(%rip)
; LINUX-64-STATIC-NEXT: retq
;
; LINUX-32-STATIC-LABEL: ind07:
; LINUX-32-STATIC: # %bb.0: # %entry
; LINUX-32-STATIC-NEXT: movl {{[0-9]+}}(%esp), %eax
; LINUX-32-STATIC-NEXT: leal ldst(,%eax,4), %eax
; LINUX-32-STATIC-NEXT: movl %eax, lptr
; LINUX-32-STATIC-NEXT: retl
;
; LINUX-32-PIC-LABEL: ind07:
; LINUX-32-PIC: # %bb.0: # %entry
; LINUX-32-PIC-NEXT: movl {{[0-9]+}}(%esp), %eax
; LINUX-32-PIC-NEXT: leal ldst(,%eax,4), %eax
; LINUX-32-PIC-NEXT: movl %eax, lptr
; LINUX-32-PIC-NEXT: retl
;
; LINUX-64-PIC-LABEL: ind07:
; LINUX-64-PIC: # %bb.0: # %entry
; LINUX-64-PIC-NEXT: leaq ldst(%rip), %rax
; LINUX-64-PIC-NEXT: leaq (%rax,%rdi,4), %rax
; LINUX-64-PIC-NEXT: movq %rax, lptr(%rip)
; LINUX-64-PIC-NEXT: retq
;
; DARWIN-32-STATIC-LABEL: ind07:
; DARWIN-32-STATIC: ## %bb.0: ## %entry
; DARWIN-32-STATIC-NEXT: movl {{[0-9]+}}(%esp), %eax
; DARWIN-32-STATIC-NEXT: leal _ldst(,%eax,4), %eax
; DARWIN-32-STATIC-NEXT: movl %eax, _lptr
; DARWIN-32-STATIC-NEXT: retl
;
; DARWIN-32-DYNAMIC-LABEL: ind07:
; DARWIN-32-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-32-DYNAMIC-NEXT: movl {{[0-9]+}}(%esp), %eax
; DARWIN-32-DYNAMIC-NEXT: leal _ldst(,%eax,4), %eax
; DARWIN-32-DYNAMIC-NEXT: movl %eax, _lptr
; DARWIN-32-DYNAMIC-NEXT: retl
;
; DARWIN-32-PIC-LABEL: ind07:
; DARWIN-32-PIC: ## %bb.0: ## %entry
; DARWIN-32-PIC-NEXT: calll L34$pb
; DARWIN-32-PIC-NEXT: L34$pb:
; DARWIN-32-PIC-NEXT: popl %eax
; DARWIN-32-PIC-NEXT: movl {{[0-9]+}}(%esp), %ecx
; DARWIN-32-PIC-NEXT: leal _ldst-L34$pb(%eax,%ecx,4), %ecx
; DARWIN-32-PIC-NEXT: movl %ecx, _lptr-L34$pb(%eax)
; DARWIN-32-PIC-NEXT: retl
;
; DARWIN-64-STATIC-LABEL: ind07:
; DARWIN-64-STATIC: ## %bb.0: ## %entry
; DARWIN-64-STATIC-NEXT: leaq _ldst(%rip), %rax
; DARWIN-64-STATIC-NEXT: leaq (%rax,%rdi,4), %rax
; DARWIN-64-STATIC-NEXT: movq %rax, _lptr(%rip)
; DARWIN-64-STATIC-NEXT: retq
;
; DARWIN-64-DYNAMIC-LABEL: ind07:
; DARWIN-64-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-64-DYNAMIC-NEXT: leaq _ldst(%rip), %rax
; DARWIN-64-DYNAMIC-NEXT: leaq (%rax,%rdi,4), %rax
; DARWIN-64-DYNAMIC-NEXT: movq %rax, _lptr(%rip)
; DARWIN-64-DYNAMIC-NEXT: retq
;
; DARWIN-64-PIC-LABEL: ind07:
; DARWIN-64-PIC: ## %bb.0: ## %entry
; DARWIN-64-PIC-NEXT: leaq _ldst(%rip), %rax
; DARWIN-64-PIC-NEXT: leaq (%rax,%rdi,4), %rax
; DARWIN-64-PIC-NEXT: movq %rax, _lptr(%rip)
; DARWIN-64-PIC-NEXT: retq
entry:
%0 = getelementptr [131072 x i32], [131072 x i32]* @ldst, i64 0, i64 %i
store i32* %0, i32** @lptr, align 8
ret void
}
define void @ind08(i64 %i) nounwind {
; LINUX-64-STATIC-LABEL: ind08:
; LINUX-64-STATIC: # %bb.0: # %entry
; LINUX-64-STATIC-NEXT: movl lsrc(,%rdi,4), %eax
; LINUX-64-STATIC-NEXT: movq lptr(%rip), %rcx
; LINUX-64-STATIC-NEXT: movl %eax, (%rcx,%rdi,4)
; LINUX-64-STATIC-NEXT: retq
;
; LINUX-32-STATIC-LABEL: ind08:
; LINUX-32-STATIC: # %bb.0: # %entry
; LINUX-32-STATIC-NEXT: movl {{[0-9]+}}(%esp), %eax
; LINUX-32-STATIC-NEXT: movl lsrc(,%eax,4), %ecx
; LINUX-32-STATIC-NEXT: movl lptr, %edx
; LINUX-32-STATIC-NEXT: movl %ecx, (%edx,%eax,4)
; LINUX-32-STATIC-NEXT: retl
;
; LINUX-32-PIC-LABEL: ind08:
; LINUX-32-PIC: # %bb.0: # %entry
; LINUX-32-PIC-NEXT: movl {{[0-9]+}}(%esp), %eax
; LINUX-32-PIC-NEXT: movl lsrc(,%eax,4), %ecx
; LINUX-32-PIC-NEXT: movl lptr, %edx
; LINUX-32-PIC-NEXT: movl %ecx, (%edx,%eax,4)
; LINUX-32-PIC-NEXT: retl
;
; LINUX-64-PIC-LABEL: ind08:
; LINUX-64-PIC: # %bb.0: # %entry
; LINUX-64-PIC-NEXT: leaq lsrc(%rip), %rax
; LINUX-64-PIC-NEXT: movl (%rax,%rdi,4), %eax
; LINUX-64-PIC-NEXT: movq lptr(%rip), %rcx
; LINUX-64-PIC-NEXT: movl %eax, (%rcx,%rdi,4)
; LINUX-64-PIC-NEXT: retq
;
; DARWIN-32-STATIC-LABEL: ind08:
; DARWIN-32-STATIC: ## %bb.0: ## %entry
; DARWIN-32-STATIC-NEXT: movl {{[0-9]+}}(%esp), %eax
; DARWIN-32-STATIC-NEXT: movl _lsrc(,%eax,4), %ecx
; DARWIN-32-STATIC-NEXT: movl _lptr, %edx
; DARWIN-32-STATIC-NEXT: movl %ecx, (%edx,%eax,4)
; DARWIN-32-STATIC-NEXT: retl
;
; DARWIN-32-DYNAMIC-LABEL: ind08:
; DARWIN-32-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-32-DYNAMIC-NEXT: movl {{[0-9]+}}(%esp), %eax
; DARWIN-32-DYNAMIC-NEXT: movl _lsrc(,%eax,4), %ecx
; DARWIN-32-DYNAMIC-NEXT: movl _lptr, %edx
; DARWIN-32-DYNAMIC-NEXT: movl %ecx, (%edx,%eax,4)
; DARWIN-32-DYNAMIC-NEXT: retl
;
; DARWIN-32-PIC-LABEL: ind08:
; DARWIN-32-PIC: ## %bb.0: ## %entry
; DARWIN-32-PIC-NEXT: calll L35$pb
; DARWIN-32-PIC-NEXT: L35$pb:
; DARWIN-32-PIC-NEXT: popl %eax
; DARWIN-32-PIC-NEXT: movl {{[0-9]+}}(%esp), %ecx
; DARWIN-32-PIC-NEXT: movl _lsrc-L35$pb(%eax,%ecx,4), %edx
; DARWIN-32-PIC-NEXT: movl _lptr-L35$pb(%eax), %eax
; DARWIN-32-PIC-NEXT: movl %edx, (%eax,%ecx,4)
; DARWIN-32-PIC-NEXT: retl
;
; DARWIN-64-STATIC-LABEL: ind08:
; DARWIN-64-STATIC: ## %bb.0: ## %entry
; DARWIN-64-STATIC-NEXT: leaq _lsrc(%rip), %rax
; DARWIN-64-STATIC-NEXT: movl (%rax,%rdi,4), %eax
; DARWIN-64-STATIC-NEXT: movq _lptr(%rip), %rcx
; DARWIN-64-STATIC-NEXT: movl %eax, (%rcx,%rdi,4)
; DARWIN-64-STATIC-NEXT: retq
;
; DARWIN-64-DYNAMIC-LABEL: ind08:
; DARWIN-64-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-64-DYNAMIC-NEXT: leaq _lsrc(%rip), %rax
; DARWIN-64-DYNAMIC-NEXT: movl (%rax,%rdi,4), %eax
; DARWIN-64-DYNAMIC-NEXT: movq _lptr(%rip), %rcx
; DARWIN-64-DYNAMIC-NEXT: movl %eax, (%rcx,%rdi,4)
; DARWIN-64-DYNAMIC-NEXT: retq
;
; DARWIN-64-PIC-LABEL: ind08:
; DARWIN-64-PIC: ## %bb.0: ## %entry
; DARWIN-64-PIC-NEXT: leaq _lsrc(%rip), %rax
; DARWIN-64-PIC-NEXT: movl (%rax,%rdi,4), %eax
; DARWIN-64-PIC-NEXT: movq _lptr(%rip), %rcx
; DARWIN-64-PIC-NEXT: movl %eax, (%rcx,%rdi,4)
; DARWIN-64-PIC-NEXT: retq
entry:
%0 = load i32*, i32** @lptr, align 8
%1 = getelementptr [131072 x i32], [131072 x i32]* @lsrc, i64 0, i64 %i
%2 = load i32, i32* %1, align 4
%3 = getelementptr i32, i32* %0, i64 %i
store i32 %2, i32* %3, align 4
ret void
}
define void @off00(i64 %i) nounwind {
; LINUX-64-STATIC-LABEL: off00:
; LINUX-64-STATIC: # %bb.0: # %entry
; LINUX-64-STATIC-NEXT: movl src+64(,%rdi,4), %eax
; LINUX-64-STATIC-NEXT: movl %eax, dst+64(,%rdi,4)
; LINUX-64-STATIC-NEXT: retq
;
; LINUX-32-STATIC-LABEL: off00:
; LINUX-32-STATIC: # %bb.0: # %entry
; LINUX-32-STATIC-NEXT: movl {{[0-9]+}}(%esp), %eax
; LINUX-32-STATIC-NEXT: movl src+64(,%eax,4), %ecx
; LINUX-32-STATIC-NEXT: movl %ecx, dst+64(,%eax,4)
; LINUX-32-STATIC-NEXT: retl
;
; LINUX-32-PIC-LABEL: off00:
; LINUX-32-PIC: # %bb.0: # %entry
; LINUX-32-PIC-NEXT: movl {{[0-9]+}}(%esp), %eax
; LINUX-32-PIC-NEXT: movl src+64(,%eax,4), %ecx
; LINUX-32-PIC-NEXT: movl %ecx, dst+64(,%eax,4)
; LINUX-32-PIC-NEXT: retl
;
; LINUX-64-PIC-LABEL: off00:
; LINUX-64-PIC: # %bb.0: # %entry
; LINUX-64-PIC-NEXT: movq src@GOTPCREL(%rip), %rax
; LINUX-64-PIC-NEXT: movl 64(%rax,%rdi,4), %eax
; LINUX-64-PIC-NEXT: movq dst@GOTPCREL(%rip), %rcx
; LINUX-64-PIC-NEXT: movl %eax, 64(%rcx,%rdi,4)
; LINUX-64-PIC-NEXT: retq
;
; DARWIN-32-STATIC-LABEL: off00:
; DARWIN-32-STATIC: ## %bb.0: ## %entry
; DARWIN-32-STATIC-NEXT: movl {{[0-9]+}}(%esp), %eax
; DARWIN-32-STATIC-NEXT: movl _src+64(,%eax,4), %ecx
; DARWIN-32-STATIC-NEXT: movl %ecx, _dst+64(,%eax,4)
; DARWIN-32-STATIC-NEXT: retl
;
; DARWIN-32-DYNAMIC-LABEL: off00:
; DARWIN-32-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-32-DYNAMIC-NEXT: movl {{[0-9]+}}(%esp), %eax
; DARWIN-32-DYNAMIC-NEXT: movl L_src$non_lazy_ptr, %ecx
; DARWIN-32-DYNAMIC-NEXT: movl 64(%ecx,%eax,4), %ecx
; DARWIN-32-DYNAMIC-NEXT: movl L_dst$non_lazy_ptr, %edx
; DARWIN-32-DYNAMIC-NEXT: movl %ecx, 64(%edx,%eax,4)
; DARWIN-32-DYNAMIC-NEXT: retl
;
; DARWIN-32-PIC-LABEL: off00:
; DARWIN-32-PIC: ## %bb.0: ## %entry
; DARWIN-32-PIC-NEXT: calll L36$pb
; DARWIN-32-PIC-NEXT: L36$pb:
; DARWIN-32-PIC-NEXT: popl %eax
; DARWIN-32-PIC-NEXT: movl {{[0-9]+}}(%esp), %ecx
; DARWIN-32-PIC-NEXT: movl L_src$non_lazy_ptr-L36$pb(%eax), %edx
; DARWIN-32-PIC-NEXT: movl 64(%edx,%ecx,4), %edx
; DARWIN-32-PIC-NEXT: movl L_dst$non_lazy_ptr-L36$pb(%eax), %eax
; DARWIN-32-PIC-NEXT: movl %edx, 64(%eax,%ecx,4)
; DARWIN-32-PIC-NEXT: retl
;
; DARWIN-64-STATIC-LABEL: off00:
; DARWIN-64-STATIC: ## %bb.0: ## %entry
; DARWIN-64-STATIC-NEXT: movq _src@GOTPCREL(%rip), %rax
; DARWIN-64-STATIC-NEXT: movl 64(%rax,%rdi,4), %eax
; DARWIN-64-STATIC-NEXT: movq _dst@GOTPCREL(%rip), %rcx
; DARWIN-64-STATIC-NEXT: movl %eax, 64(%rcx,%rdi,4)
; DARWIN-64-STATIC-NEXT: retq
;
; DARWIN-64-DYNAMIC-LABEL: off00:
; DARWIN-64-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-64-DYNAMIC-NEXT: movq _src@GOTPCREL(%rip), %rax
; DARWIN-64-DYNAMIC-NEXT: movl 64(%rax,%rdi,4), %eax
; DARWIN-64-DYNAMIC-NEXT: movq _dst@GOTPCREL(%rip), %rcx
; DARWIN-64-DYNAMIC-NEXT: movl %eax, 64(%rcx,%rdi,4)
; DARWIN-64-DYNAMIC-NEXT: retq
;
; DARWIN-64-PIC-LABEL: off00:
; DARWIN-64-PIC: ## %bb.0: ## %entry
; DARWIN-64-PIC-NEXT: movq _src@GOTPCREL(%rip), %rax
; DARWIN-64-PIC-NEXT: movl 64(%rax,%rdi,4), %eax
; DARWIN-64-PIC-NEXT: movq _dst@GOTPCREL(%rip), %rcx
; DARWIN-64-PIC-NEXT: movl %eax, 64(%rcx,%rdi,4)
; DARWIN-64-PIC-NEXT: retq
entry:
%0 = add i64 %i, 16
%1 = getelementptr [131072 x i32], [131072 x i32]* @src, i64 0, i64 %0
%2 = load i32, i32* %1, align 4
%3 = getelementptr [131072 x i32], [131072 x i32]* @dst, i64 0, i64 %0
store i32 %2, i32* %3, align 4
ret void
}
define void @oxf00(i64 %i) nounwind {
; LINUX-64-STATIC-LABEL: oxf00:
; LINUX-64-STATIC: # %bb.0: # %entry
; LINUX-64-STATIC-NEXT: movl xsrc+64(,%rdi,4), %eax
; LINUX-64-STATIC-NEXT: movl %eax, xdst+64(,%rdi,4)
; LINUX-64-STATIC-NEXT: retq
;
; LINUX-32-STATIC-LABEL: oxf00:
; LINUX-32-STATIC: # %bb.0: # %entry
; LINUX-32-STATIC-NEXT: movl {{[0-9]+}}(%esp), %eax
; LINUX-32-STATIC-NEXT: movl xsrc+64(,%eax,4), %ecx
; LINUX-32-STATIC-NEXT: movl %ecx, xdst+64(,%eax,4)
; LINUX-32-STATIC-NEXT: retl
;
; LINUX-32-PIC-LABEL: oxf00:
; LINUX-32-PIC: # %bb.0: # %entry
; LINUX-32-PIC-NEXT: movl {{[0-9]+}}(%esp), %eax
; LINUX-32-PIC-NEXT: movl xsrc+64(,%eax,4), %ecx
; LINUX-32-PIC-NEXT: movl %ecx, xdst+64(,%eax,4)
; LINUX-32-PIC-NEXT: retl
;
; LINUX-64-PIC-LABEL: oxf00:
; LINUX-64-PIC: # %bb.0: # %entry
; LINUX-64-PIC-NEXT: movq xsrc@GOTPCREL(%rip), %rax
; LINUX-64-PIC-NEXT: movl 64(%rax,%rdi,4), %eax
; LINUX-64-PIC-NEXT: movq xdst@GOTPCREL(%rip), %rcx
; LINUX-64-PIC-NEXT: movl %eax, 64(%rcx,%rdi,4)
; LINUX-64-PIC-NEXT: retq
;
; DARWIN-32-STATIC-LABEL: oxf00:
; DARWIN-32-STATIC: ## %bb.0: ## %entry
; DARWIN-32-STATIC-NEXT: movl {{[0-9]+}}(%esp), %eax
; DARWIN-32-STATIC-NEXT: movl _xsrc+64(,%eax,4), %ecx
; DARWIN-32-STATIC-NEXT: movl %ecx, _xdst+64(,%eax,4)
; DARWIN-32-STATIC-NEXT: retl
;
; DARWIN-32-DYNAMIC-LABEL: oxf00:
; DARWIN-32-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-32-DYNAMIC-NEXT: movl {{[0-9]+}}(%esp), %eax
; DARWIN-32-DYNAMIC-NEXT: movl L_xsrc$non_lazy_ptr, %ecx
; DARWIN-32-DYNAMIC-NEXT: movl 64(%ecx,%eax,4), %ecx
; DARWIN-32-DYNAMIC-NEXT: movl L_xdst$non_lazy_ptr, %edx
; DARWIN-32-DYNAMIC-NEXT: movl %ecx, 64(%edx,%eax,4)
; DARWIN-32-DYNAMIC-NEXT: retl
;
; DARWIN-32-PIC-LABEL: oxf00:
; DARWIN-32-PIC: ## %bb.0: ## %entry
; DARWIN-32-PIC-NEXT: calll L37$pb
; DARWIN-32-PIC-NEXT: L37$pb:
; DARWIN-32-PIC-NEXT: popl %eax
; DARWIN-32-PIC-NEXT: movl {{[0-9]+}}(%esp), %ecx
; DARWIN-32-PIC-NEXT: movl L_xsrc$non_lazy_ptr-L37$pb(%eax), %edx
; DARWIN-32-PIC-NEXT: movl 64(%edx,%ecx,4), %edx
; DARWIN-32-PIC-NEXT: movl L_xdst$non_lazy_ptr-L37$pb(%eax), %eax
; DARWIN-32-PIC-NEXT: movl %edx, 64(%eax,%ecx,4)
; DARWIN-32-PIC-NEXT: retl
;
; DARWIN-64-STATIC-LABEL: oxf00:
; DARWIN-64-STATIC: ## %bb.0: ## %entry
; DARWIN-64-STATIC-NEXT: movq _xsrc@GOTPCREL(%rip), %rax
; DARWIN-64-STATIC-NEXT: movl 64(%rax,%rdi,4), %eax
; DARWIN-64-STATIC-NEXT: movq _xdst@GOTPCREL(%rip), %rcx
; DARWIN-64-STATIC-NEXT: movl %eax, 64(%rcx,%rdi,4)
; DARWIN-64-STATIC-NEXT: retq
;
; DARWIN-64-DYNAMIC-LABEL: oxf00:
; DARWIN-64-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-64-DYNAMIC-NEXT: movq _xsrc@GOTPCREL(%rip), %rax
; DARWIN-64-DYNAMIC-NEXT: movl 64(%rax,%rdi,4), %eax
; DARWIN-64-DYNAMIC-NEXT: movq _xdst@GOTPCREL(%rip), %rcx
; DARWIN-64-DYNAMIC-NEXT: movl %eax, 64(%rcx,%rdi,4)
; DARWIN-64-DYNAMIC-NEXT: retq
;
; DARWIN-64-PIC-LABEL: oxf00:
; DARWIN-64-PIC: ## %bb.0: ## %entry
; DARWIN-64-PIC-NEXT: movq _xsrc@GOTPCREL(%rip), %rax
; DARWIN-64-PIC-NEXT: movl 64(%rax,%rdi,4), %eax
; DARWIN-64-PIC-NEXT: movq _xdst@GOTPCREL(%rip), %rcx
; DARWIN-64-PIC-NEXT: movl %eax, 64(%rcx,%rdi,4)
; DARWIN-64-PIC-NEXT: retq
entry:
%0 = add i64 %i, 16
%1 = getelementptr [32 x i32], [32 x i32]* @xsrc, i64 0, i64 %0
%2 = load i32, i32* %1, align 4
%3 = getelementptr [32 x i32], [32 x i32]* @xdst, i64 0, i64 %0
store i32 %2, i32* %3, align 4
ret void
}
define void @off01(i64 %i) nounwind {
; LINUX-64-STATIC-LABEL: off01:
; LINUX-64-STATIC: # %bb.0: # %entry
; LINUX-64-STATIC-NEXT: leaq dst+64(,%rdi,4), %rax
; LINUX-64-STATIC-NEXT: movq %rax, ptr(%rip)
; LINUX-64-STATIC-NEXT: retq
;
; LINUX-32-STATIC-LABEL: off01:
; LINUX-32-STATIC: # %bb.0: # %entry
; LINUX-32-STATIC-NEXT: movl {{[0-9]+}}(%esp), %eax
; LINUX-32-STATIC-NEXT: leal dst+64(,%eax,4), %eax
; LINUX-32-STATIC-NEXT: movl %eax, ptr
; LINUX-32-STATIC-NEXT: retl
;
; LINUX-32-PIC-LABEL: off01:
; LINUX-32-PIC: # %bb.0: # %entry
; LINUX-32-PIC-NEXT: movl {{[0-9]+}}(%esp), %eax
; LINUX-32-PIC-NEXT: leal dst+64(,%eax,4), %eax
; LINUX-32-PIC-NEXT: movl %eax, ptr
; LINUX-32-PIC-NEXT: retl
;
; LINUX-64-PIC-LABEL: off01:
; LINUX-64-PIC: # %bb.0: # %entry
; LINUX-64-PIC-NEXT: movq dst@GOTPCREL(%rip), %rax
; LINUX-64-PIC-NEXT: leaq 64(%rax,%rdi,4), %rax
; LINUX-64-PIC-NEXT: movq ptr@GOTPCREL(%rip), %rcx
; LINUX-64-PIC-NEXT: movq %rax, (%rcx)
; LINUX-64-PIC-NEXT: retq
;
; DARWIN-32-STATIC-LABEL: off01:
; DARWIN-32-STATIC: ## %bb.0: ## %entry
; DARWIN-32-STATIC-NEXT: movl {{[0-9]+}}(%esp), %eax
; DARWIN-32-STATIC-NEXT: leal _dst+64(,%eax,4), %eax
; DARWIN-32-STATIC-NEXT: movl %eax, _ptr
; DARWIN-32-STATIC-NEXT: retl
;
; DARWIN-32-DYNAMIC-LABEL: off01:
; DARWIN-32-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-32-DYNAMIC-NEXT: movl {{[0-9]+}}(%esp), %eax
; DARWIN-32-DYNAMIC-NEXT: movl L_dst$non_lazy_ptr, %ecx
; DARWIN-32-DYNAMIC-NEXT: leal 64(%ecx,%eax,4), %eax
; DARWIN-32-DYNAMIC-NEXT: movl L_ptr$non_lazy_ptr, %ecx
; DARWIN-32-DYNAMIC-NEXT: movl %eax, (%ecx)
; DARWIN-32-DYNAMIC-NEXT: retl
;
; DARWIN-32-PIC-LABEL: off01:
; DARWIN-32-PIC: ## %bb.0: ## %entry
; DARWIN-32-PIC-NEXT: calll L38$pb
; DARWIN-32-PIC-NEXT: L38$pb:
; DARWIN-32-PIC-NEXT: popl %eax
; DARWIN-32-PIC-NEXT: movl {{[0-9]+}}(%esp), %ecx
; DARWIN-32-PIC-NEXT: movl L_dst$non_lazy_ptr-L38$pb(%eax), %edx
; DARWIN-32-PIC-NEXT: leal 64(%edx,%ecx,4), %ecx
; DARWIN-32-PIC-NEXT: movl L_ptr$non_lazy_ptr-L38$pb(%eax), %eax
; DARWIN-32-PIC-NEXT: movl %ecx, (%eax)
; DARWIN-32-PIC-NEXT: retl
;
; DARWIN-64-STATIC-LABEL: off01:
; DARWIN-64-STATIC: ## %bb.0: ## %entry
; DARWIN-64-STATIC-NEXT: movq _dst@GOTPCREL(%rip), %rax
; DARWIN-64-STATIC-NEXT: leaq 64(%rax,%rdi,4), %rax
; DARWIN-64-STATIC-NEXT: movq _ptr@GOTPCREL(%rip), %rcx
; DARWIN-64-STATIC-NEXT: movq %rax, (%rcx)
; DARWIN-64-STATIC-NEXT: retq
;
; DARWIN-64-DYNAMIC-LABEL: off01:
; DARWIN-64-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-64-DYNAMIC-NEXT: movq _dst@GOTPCREL(%rip), %rax
; DARWIN-64-DYNAMIC-NEXT: leaq 64(%rax,%rdi,4), %rax
; DARWIN-64-DYNAMIC-NEXT: movq _ptr@GOTPCREL(%rip), %rcx
; DARWIN-64-DYNAMIC-NEXT: movq %rax, (%rcx)
; DARWIN-64-DYNAMIC-NEXT: retq
;
; DARWIN-64-PIC-LABEL: off01:
; DARWIN-64-PIC: ## %bb.0: ## %entry
; DARWIN-64-PIC-NEXT: movq _dst@GOTPCREL(%rip), %rax
; DARWIN-64-PIC-NEXT: leaq 64(%rax,%rdi,4), %rax
; DARWIN-64-PIC-NEXT: movq _ptr@GOTPCREL(%rip), %rcx
; DARWIN-64-PIC-NEXT: movq %rax, (%rcx)
; DARWIN-64-PIC-NEXT: retq
entry:
%.sum = add i64 %i, 16
%0 = getelementptr [131072 x i32], [131072 x i32]* @dst, i64 0, i64 %.sum
store i32* %0, i32** @ptr, align 8
ret void
}
define void @oxf01(i64 %i) nounwind {
; LINUX-64-STATIC-LABEL: oxf01:
; LINUX-64-STATIC: # %bb.0: # %entry
; LINUX-64-STATIC-NEXT: leaq xdst+64(,%rdi,4), %rax
; LINUX-64-STATIC-NEXT: movq %rax, ptr(%rip)
; LINUX-64-STATIC-NEXT: retq
;
; LINUX-32-STATIC-LABEL: oxf01:
; LINUX-32-STATIC: # %bb.0: # %entry
; LINUX-32-STATIC-NEXT: movl {{[0-9]+}}(%esp), %eax
; LINUX-32-STATIC-NEXT: leal xdst+64(,%eax,4), %eax
; LINUX-32-STATIC-NEXT: movl %eax, ptr
; LINUX-32-STATIC-NEXT: retl
;
; LINUX-32-PIC-LABEL: oxf01:
; LINUX-32-PIC: # %bb.0: # %entry
; LINUX-32-PIC-NEXT: movl {{[0-9]+}}(%esp), %eax
; LINUX-32-PIC-NEXT: leal xdst+64(,%eax,4), %eax
; LINUX-32-PIC-NEXT: movl %eax, ptr
; LINUX-32-PIC-NEXT: retl
;
; LINUX-64-PIC-LABEL: oxf01:
; LINUX-64-PIC: # %bb.0: # %entry
; LINUX-64-PIC-NEXT: movq xdst@GOTPCREL(%rip), %rax
; LINUX-64-PIC-NEXT: leaq 64(%rax,%rdi,4), %rax
; LINUX-64-PIC-NEXT: movq ptr@GOTPCREL(%rip), %rcx
; LINUX-64-PIC-NEXT: movq %rax, (%rcx)
; LINUX-64-PIC-NEXT: retq
;
; DARWIN-32-STATIC-LABEL: oxf01:
; DARWIN-32-STATIC: ## %bb.0: ## %entry
; DARWIN-32-STATIC-NEXT: movl {{[0-9]+}}(%esp), %eax
; DARWIN-32-STATIC-NEXT: leal _xdst+64(,%eax,4), %eax
; DARWIN-32-STATIC-NEXT: movl %eax, _ptr
; DARWIN-32-STATIC-NEXT: retl
;
; DARWIN-32-DYNAMIC-LABEL: oxf01:
; DARWIN-32-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-32-DYNAMIC-NEXT: movl {{[0-9]+}}(%esp), %eax
; DARWIN-32-DYNAMIC-NEXT: movl L_xdst$non_lazy_ptr, %ecx
; DARWIN-32-DYNAMIC-NEXT: leal 64(%ecx,%eax,4), %eax
; DARWIN-32-DYNAMIC-NEXT: movl L_ptr$non_lazy_ptr, %ecx
; DARWIN-32-DYNAMIC-NEXT: movl %eax, (%ecx)
; DARWIN-32-DYNAMIC-NEXT: retl
;
; DARWIN-32-PIC-LABEL: oxf01:
; DARWIN-32-PIC: ## %bb.0: ## %entry
; DARWIN-32-PIC-NEXT: calll L39$pb
; DARWIN-32-PIC-NEXT: L39$pb:
; DARWIN-32-PIC-NEXT: popl %eax
; DARWIN-32-PIC-NEXT: movl {{[0-9]+}}(%esp), %ecx
; DARWIN-32-PIC-NEXT: movl L_xdst$non_lazy_ptr-L39$pb(%eax), %edx
; DARWIN-32-PIC-NEXT: leal 64(%edx,%ecx,4), %ecx
; DARWIN-32-PIC-NEXT: movl L_ptr$non_lazy_ptr-L39$pb(%eax), %eax
; DARWIN-32-PIC-NEXT: movl %ecx, (%eax)
; DARWIN-32-PIC-NEXT: retl
;
; DARWIN-64-STATIC-LABEL: oxf01:
; DARWIN-64-STATIC: ## %bb.0: ## %entry
; DARWIN-64-STATIC-NEXT: movq _xdst@GOTPCREL(%rip), %rax
; DARWIN-64-STATIC-NEXT: leaq 64(%rax,%rdi,4), %rax
; DARWIN-64-STATIC-NEXT: movq _ptr@GOTPCREL(%rip), %rcx
; DARWIN-64-STATIC-NEXT: movq %rax, (%rcx)
; DARWIN-64-STATIC-NEXT: retq
;
; DARWIN-64-DYNAMIC-LABEL: oxf01:
; DARWIN-64-DYNAMIC: ## %bb.0: ## %entry
; DARWIN-64-DYNAMIC-NEXT: movq _xdst@GOTPCREL(%rip), %rax
; DARWIN-64-DYNAMIC-NEXT: leaq 64(%rax,%rdi,4), %rax
; DARWIN-64-DYNAMIC-NEXT: movq _ptr@GOTPCREL(%rip), %rcx
; DARWIN-64-DYNAMIC-NEXT: movq %rax, (%rcx)
; DARWIN-64-DYNAMIC-NEXT: retq
;
; DARWIN-64-PIC-LABEL: oxf01:
; DARWIN-64-PIC: ## %bb.0: ## %entry
; DARWIN-64-PIC-NEXT: movq _xdst@GOTPCREL(%rip), %rax
; DARWIN-64-PIC-NEXT: leaq 64(%rax,%rdi,4), %rax
; DARWIN-64-PIC-NEXT: movq _ptr@GOTPCREL(%rip), %rcx
; DARWIN-64-PIC-NEXT: movq %rax, (%rcx)
; DARWIN-64-PIC-NEXT: retq
entry:
%.sum = add i64 %i, 16
%0 = getelementptr [32 x i32], [32 x i32]* @xdst, i64 0, i64 %.sum
store i32* %0, i32** @ptr, align 8