Dan Gohman | 36a0947 | 2009-09-08 23:54:48 +0000 | [diff] [blame] | 1 | ; RUN: llc < %s -mtriple=i386-apple-darwin9 | FileCheck %s -check-prefix=X32 |
| 2 | ; RUN: llc < %s -mtriple=x86_64-apple-darwin9 | FileCheck %s -check-prefix=X64 |
Evan Cheng | ae94e59 | 2008-12-05 01:06:39 +0000 | [diff] [blame] | 3 | |
| 4 | @x = external hidden global i32 ; <i32*> [#uses=1] |
| 5 | @y = extern_weak hidden global i32 ; <i32*> [#uses=1] |
| 6 | |
| 7 | define i32 @t() nounwind readonly { |
| 8 | entry: |
Evan Cheng | 63476a8 | 2009-09-03 07:04:02 +0000 | [diff] [blame] | 9 | ; X32: _t: |
| 10 | ; X32: movl _y, %eax |
| 11 | |
| 12 | ; X64: _t: |
| 13 | ; X64: movl _y(%rip), %eax |
| 14 | |
Evan Cheng | ae94e59 | 2008-12-05 01:06:39 +0000 | [diff] [blame] | 15 | %0 = load i32* @x, align 4 ; <i32> [#uses=1] |
| 16 | %1 = load i32* @y, align 4 ; <i32> [#uses=1] |
| 17 | %2 = add i32 %1, %0 ; <i32> [#uses=1] |
| 18 | ret i32 %2 |
| 19 | } |