1# RUN: ld64.lld.darwinold -arch x86_64 -macosx_version_min 10.9 %s -o %t -image_base 31415926000 %p/Inputs/x86_64/libSystem.yaml
2# RUN: llvm-readobj --macho-segment %t | FileCheck %s
3# RUN: not ld64.lld.darwinold -arch x86_64 -image_base 0x31415926530 %s >/dev/null 2> %t
4# RUN: FileCheck < %t %s --check-prefix=CHECK-ERROR-MISPAGED
5# RUN: not ld64.lld.darwinold -arch x86_64 -image_base 1000 %s >/dev/null 2> %t
6# RUN: FileCheck < %t %s --check-prefix=CHECK-ERROR-OVERLAP
7# RUN: not ld64.lld.darwinold -arch x86_64 -image_base hithere %s >/dev/null 2> %t
8# RUN: FileCheck < %t %s --check-prefix=CHECK-ERROR-NOTHEX
9
10--- !native
11defined-atoms:
12   - name:            _main
13     scope:           global
14     content:         []
15
16# CHECK: Segment {
17# CHECK:   Cmd: LC_SEGMENT_64
18# CHECK:   Name: __TEXT
19# CHECK-NEXT:   Size: 152
20# CHECK-NEXT:   vmaddr: 0x31415926000
21# CHECK-NEXT:   vmsize: 0x1000
22
23
24# CHECK-ERROR-MISPAGED: error: image_base must be a multiple of page size (0x1000)
25
26# CHECK-ERROR-OVERLAP: error: image_base overlaps with __PAGEZERO
27
28# CHECK-ERROR-NOTHEX: error: image_base expects a hex number
29