1# RUN: ld64.lld.darwinold -arch i386 -macosx_version_min 10.8 %s %p/Inputs/hello-world-x86.yaml -o %t && llvm-nm -m %t | FileCheck %s
2# RUN: not ld64.lld.darwinold -arch i386 -ios_simulator_version_min 5.0 %s %p/Inputs/hello-world-x86.yaml -o %t 2>&1 | FileCheck %s --check-prefix=ERROR
3#
4# Test that i386 can link with a macos version but gives an error with a simulator version.
5#
6
7--- !mach-o
8arch:            x86
9OS:              Mac OS X
10file-type:       MH_OBJECT
11flags:           [ MH_SUBSECTIONS_VIA_SYMBOLS ]
12sections:
13  - segment:         __TEXT
14    section:         __text
15    type:            S_REGULAR
16    attributes:      [ S_ATTR_PURE_INSTRUCTIONS, S_ATTR_SOME_INSTRUCTIONS ]
17    address:         0x0000000000000000
18    content:         [ 0x90 ]
19global-symbols:
20  - name:            _main
21    type:            N_SECT
22    scope:           [ N_EXT ]
23    sect:            1
24    value:           0x0000000000000000
25...
26
27# CHECK:	{{[0-9a-f]+}} (__TEXT,__text) external _main
28# CHECK:	(undefined) external dyld_stub_binder (from libSystem)
29
30# ERROR: cannot be linked due to incompatible operating systems
31