blob: 24ff07b4b2199d8af9727f8fc3601a4c2d9acc74 [file] [log] [blame]
Dan Gohman0a063102009-09-08 23:54:48 +00001; RUN: llc < %s -march=x86-64 -relocation-model=pic -mtriple=x86_64-apple-darwin10 | FileCheck %s -check-prefix=PIC64
2; RUN: llc < %s -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}