blob: a41b8a960f25f7eae3f023f59b34d966cd63cf0f [file] [log] [blame]
Nick Lewycky8a702d92009-07-11 23:48:59 +00001; RUN: llvm-as < %s | llc -march=x86-64 -relocation-model=pic -mtriple=x86_64-apple-darwin10 | FileCheck %s -check-prefix=PIC64
Chris Lattner0fd13582009-07-11 22:30:05 +00002; RUN: llvm-as < %s | llc -mtriple=x86_64-unknown-linux-gnu -relocation-model=static | FileCheck %s -check-prefix=STATIC64
Dan Gohmane254f322009-03-14 02:33:41 +00003
Dan Gohman728fd182009-08-20 18:23:44 +00004; Use %rip-relative addressing even in static mode on x86-64, because
5; it has a smaller encoding.
6
Dan Gohmane254f322009-03-14 02:33:41 +00007@a = internal global double 3.4
8define double @foo() nounwind {
9 %a = load double* @a
10 ret double %a
Chris Lattner0fd13582009-07-11 22:30:05 +000011
12; PIC64: movsd _a(%rip), %xmm0
Dan Gohman728fd182009-08-20 18:23:44 +000013; STATIC64: movsd a(%rip), %xmm0
Dan Gohmane254f322009-03-14 02:33:41 +000014}