2014-09-11 18:31:42 +08:00
|
|
|
# RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.9 %s -o %t -image_base 31415926000 %p/Inputs/libSystem.yaml
|
2014-09-10 18:39:57 +08:00
|
|
|
# RUN: macho-dump %t | FileCheck %s
|
2014-09-11 18:31:46 +08:00
|
|
|
# RUN: not lld -flavor darwin -arch x86_64 -image_base 0x31415926530 %s >/dev/null 2> %t
|
2014-09-11 18:31:42 +08:00
|
|
|
# RUN: FileCheck < %t %s --check-prefix=CHECK-ERROR-MISPAGED
|
|
|
|
# RUN: not lld -flavor darwin -arch x86_64 -image_base 1000 %s >/dev/null 2> %t
|
|
|
|
# RUN: FileCheck < %t %s --check-prefix=CHECK-ERROR-OVERLAP
|
|
|
|
# RUN: not lld -flavor darwin -arch x86_64 -image_base hithere %s >/dev/null 2> %t
|
|
|
|
# RUN: FileCheck < %t %s --check-prefix=CHECK-ERROR-NOTHEX
|
2014-09-10 18:39:57 +08:00
|
|
|
|
|
|
|
--- !native
|
|
|
|
defined-atoms:
|
|
|
|
- name: _main
|
|
|
|
scope: global
|
|
|
|
content: []
|
|
|
|
|
|
|
|
# Unfortunately, llvm-objdump and llvm-readobj are too generic and don't give
|
|
|
|
# us easy access to the MachO segment model, so we have to check the uglier
|
|
|
|
# macho-dump output.
|
|
|
|
# CHECK: 'segment_name', '__TEXT
|
2014-09-11 18:31:42 +08:00
|
|
|
# CHECK-NEXT: 'vm_addr', 3384796143616
|
|
|
|
|
|
|
|
|
|
|
|
# CHECK-ERROR-MISPAGED: error: image_base must be a multiple of page size (0x1000)
|
|
|
|
|
|
|
|
# CHECK-ERROR-OVERLAP: error: image_base overlaps with __PAGEZERO
|
|
|
|
|
|
|
|
# CHECK-ERROR-NOTHEX: error: image_base expects a hex number
|