The test needs an object file, which it currenty gets with
`-target x86_64-apple-darwin10`. Rather than adding `REQUIRES: X86`, create
the object file via yaml2obj. This way, the test runs and passes even if the
host arch isn't x86 and only the host arch is built.
Part of PR46644.
llvm-readobj
llvm-symbolizer
opt
+ yaml2obj
)
if(TARGET llvm-lto)
--- /dev/null
+# Created by `clang -target x86_64-apple-darwin10 -c -x c /dev/null -o - | obj2yaml`.
+--- !mach-o
+FileHeader:
+ magic: 0xFEEDFACF
+ cputype: 0x1000007
+ cpusubtype: 0x3
+ filetype: 0x1
+ ncmds: 2
+ sizeofcmds: 176
+ flags: 0x2000
+ reserved: 0x0
+LoadCommands:
+ - cmd: LC_SEGMENT_64
+ cmdsize: 152
+ segname: ''
+ vmaddr: 0
+ vmsize: 0
+ fileoff: 208
+ filesize: 0
+ maxprot: 7
+ initprot: 7
+ nsects: 1
+ flags: 0
+ Sections:
+ - sectname: __text
+ segname: __TEXT
+ addr: 0x0
+ size: 0
+ offset: 0xD0
+ align: 0
+ reloff: 0x0
+ nreloc: 0
+ flags: 0x80000000
+ reserved1: 0x0
+ reserved2: 0x0
+ reserved3: 0x0
+ content: ''
+ - cmd: LC_BUILD_VERSION
+ cmdsize: 24
+ platform: 1
+ minos: 720896
+ sdk: 720896
+ ntools: 0
+...
// Do *not* add -no_deduplicate when no -O option is specified and this is just a link
// (since we can't imply -O0)
// RUN: rm -f %t.o %t.bin
-// RUN: %clang -target x86_64-apple-darwin10 -c -o %t.o %s
+// RUN: yaml2obj %S/Inputs/empty-x86_64-apple-darwin.yaml -o %t.o
// RUN: %clang -target x86_64-apple-darwin10 %t.o -### -mlinker-version=262 \
// RUN: -o %t.bin 2>&1 | FileCheck -check-prefix=LINK_DEDUP %s
// RUN: %clang -target x86_64-apple-darwin10 %t.o -### -mlinker-version=262 \
tools = [
'apinotes-test', 'c-index-test', 'clang-diff', 'clang-format',
- 'clang-tblgen', 'opt', 'llvm-ifs',
+ 'clang-tblgen', 'opt', 'llvm-ifs', 'yaml2obj',
ToolSubst('%clang_extdef_map', command=FindTool(
'clang-extdef-mapping'), unresolved='ignore'),
]
"//llvm/utils/count",
"//llvm/utils/llvm-lit",
"//llvm/utils/not",
+ "//llvm/tools/yaml2obj",
]
if (clang_enable_arcmt) {
deps += [