Tim Northover | 00ed996 | 2014-03-29 10:18:08 +0000 | [diff] [blame] | 1 | ; RUN: llc -mtriple=arm64-apple-ios < %s | FileCheck %s |
| 2 | ; RUN: llc -mtriple=arm64-linux-gnu -relocation-model=pic < %s | FileCheck %s --check-prefix=CHECK-LINUX |
| 3 | ; <rdar://problem/11392109> |
| 4 | |
Tim Northover | ce6538c | 2014-05-30 08:59:55 +0000 | [diff] [blame] | 5 | define hidden void @t(i64* %addr) optsize ssp { |
Tim Northover | 00ed996 | 2014-03-29 10:18:08 +0000 | [diff] [blame] | 6 | entry: |
Tim Northover | ce6538c | 2014-05-30 08:59:55 +0000 | [diff] [blame] | 7 | store i64 zext (i32 ptrtoint (i64 (i32)* @x to i32) to i64), i64* %addr, align 8 |
Tim Northover | 00ed996 | 2014-03-29 10:18:08 +0000 | [diff] [blame] | 8 | ; CHECK: adrp x{{[0-9]+}}, _x@GOTPAGE |
| 9 | ; CHECK: ldr x{{[0-9]+}}, [x{{[0-9]+}}, _x@GOTPAGEOFF] |
| 10 | ; CHECK-NEXT: and x{{[0-9]+}}, x{{[0-9]+}}, #0xffffffff |
| 11 | ; CHECK-NEXT: str x{{[0-9]+}}, [x{{[0-9]+}}] |
Tim Northover | ce6538c | 2014-05-30 08:59:55 +0000 | [diff] [blame] | 12 | ret void |
Tim Northover | 00ed996 | 2014-03-29 10:18:08 +0000 | [diff] [blame] | 13 | } |
| 14 | |
| 15 | declare i64 @x(i32) optsize |
| 16 | |
| 17 | ; Worth checking the Linux code is sensible too: only way to access |
| 18 | ; the GOT is via a 64-bit load. Just loading wN is unacceptable |
| 19 | ; (there's no ELF relocation to do that). |
| 20 | |
| 21 | ; CHECK-LINUX: adrp {{x[0-9]+}}, :got:x |
| 22 | ; CHECK-LINUX: ldr {{x[0-9]+}}, [{{x[0-9]+}}, :got_lo12:x] |