Dan Gohman | 0a06310 | 2009-09-08 23:54:48 +0000 | [diff] [blame^] | 1 | ; 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 Gohman | e254f32 | 2009-03-14 02:33:41 +0000 | [diff] [blame] | 3 | |
Dan Gohman | 728fd18 | 2009-08-20 18:23:44 +0000 | [diff] [blame] | 4 | ; Use %rip-relative addressing even in static mode on x86-64, because |
| 5 | ; it has a smaller encoding. |
| 6 | |
Dan Gohman | e254f32 | 2009-03-14 02:33:41 +0000 | [diff] [blame] | 7 | @a = internal global double 3.4 |
| 8 | define double @foo() nounwind { |
| 9 | %a = load double* @a |
| 10 | ret double %a |
Chris Lattner | 0fd1358 | 2009-07-11 22:30:05 +0000 | [diff] [blame] | 11 | |
| 12 | ; PIC64: movsd _a(%rip), %xmm0 |
Dan Gohman | 728fd18 | 2009-08-20 18:23:44 +0000 | [diff] [blame] | 13 | ; STATIC64: movsd a(%rip), %xmm0 |
Dan Gohman | e254f32 | 2009-03-14 02:33:41 +0000 | [diff] [blame] | 14 | } |