forked from OSchip/llvm-project
Use the mach-o MH_* name for file types in yaml
llvm-svn: 198725
This commit is contained in:
parent
0dba9b33f0
commit
360a1434f0
|
@ -153,10 +153,10 @@ struct ScalarEnumerationTraits<lld::MachOLinkingContext::OS> {
|
|||
template <>
|
||||
struct ScalarEnumerationTraits<HeaderFileType> {
|
||||
static void enumeration(IO &io, HeaderFileType &value) {
|
||||
io.enumCase(value, "object", llvm::MachO::MH_OBJECT);
|
||||
io.enumCase(value, "dylib", llvm::MachO::MH_DYLIB);
|
||||
io.enumCase(value, "executable", llvm::MachO::MH_EXECUTE);
|
||||
io.enumCase(value, "bundle", llvm::MachO::MH_BUNDLE);
|
||||
io.enumCase(value, "MH_OBJECT", llvm::MachO::MH_OBJECT);
|
||||
io.enumCase(value, "MH_DYLIB", llvm::MachO::MH_DYLIB);
|
||||
io.enumCase(value, "MH_EXECUTE", llvm::MachO::MH_EXECUTE);
|
||||
io.enumCase(value, "MH_BUNDLE", llvm::MachO::MH_BUNDLE);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ TEST(ObjectFileYAML, empty_ppc) {
|
|||
std::unique_ptr<NormalizedFile> f = fromYAML(
|
||||
"---\n"
|
||||
"arch: ppc\n"
|
||||
"file-type: object\n"
|
||||
"file-type: MH_OBJECT\n"
|
||||
"flags: [ MH_SUBSECTIONS_VIA_SYMBOLS ]\n"
|
||||
"...\n");
|
||||
EXPECT_EQ(f->arch, lld::MachOLinkingContext::arch_ppc);
|
||||
|
@ -61,7 +61,7 @@ TEST(ObjectFileYAML, empty_x86_64) {
|
|||
std::unique_ptr<NormalizedFile> f = fromYAML(
|
||||
"---\n"
|
||||
"arch: x86_64\n"
|
||||
"file-type: object\n"
|
||||
"file-type: MH_OBJECT\n"
|
||||
"flags: [ MH_SUBSECTIONS_VIA_SYMBOLS ]\n"
|
||||
"...\n");
|
||||
EXPECT_EQ(f->arch, lld::MachOLinkingContext::arch_x86_64);
|
||||
|
@ -77,7 +77,7 @@ TEST(ObjectFileYAML, empty_x86) {
|
|||
std::unique_ptr<NormalizedFile> f = fromYAML(
|
||||
"---\n"
|
||||
"arch: x86\n"
|
||||
"file-type: object\n"
|
||||
"file-type: MH_OBJECT\n"
|
||||
"flags: [ MH_SUBSECTIONS_VIA_SYMBOLS ]\n"
|
||||
"...\n");
|
||||
EXPECT_EQ(f->arch, lld::MachOLinkingContext::arch_x86);
|
||||
|
@ -93,7 +93,7 @@ TEST(ObjectFileYAML, empty_armv6) {
|
|||
std::unique_ptr<NormalizedFile> f = fromYAML(
|
||||
"---\n"
|
||||
"arch: armv6\n"
|
||||
"file-type: object\n"
|
||||
"file-type: MH_OBJECT\n"
|
||||
"flags: [ MH_SUBSECTIONS_VIA_SYMBOLS ]\n"
|
||||
"...\n");
|
||||
EXPECT_EQ(f->arch, lld::MachOLinkingContext::arch_armv6);
|
||||
|
@ -109,7 +109,7 @@ TEST(ObjectFileYAML, empty_armv7) {
|
|||
std::unique_ptr<NormalizedFile> f = fromYAML(
|
||||
"---\n"
|
||||
"arch: armv7\n"
|
||||
"file-type: object\n"
|
||||
"file-type: MH_OBJECT\n"
|
||||
"flags: [ MH_SUBSECTIONS_VIA_SYMBOLS ]\n"
|
||||
"...\n");
|
||||
EXPECT_EQ(f->arch, lld::MachOLinkingContext::arch_armv7);
|
||||
|
@ -125,7 +125,7 @@ TEST(ObjectFileYAML, empty_armv7s) {
|
|||
std::unique_ptr<NormalizedFile> f = fromYAML(
|
||||
"---\n"
|
||||
"arch: armv7s\n"
|
||||
"file-type: object\n"
|
||||
"file-type: MH_OBJECT\n"
|
||||
"flags: [ MH_SUBSECTIONS_VIA_SYMBOLS ]\n"
|
||||
"...\n");
|
||||
EXPECT_EQ(f->arch, lld::MachOLinkingContext::arch_armv7s);
|
||||
|
@ -165,7 +165,7 @@ TEST(ObjectFileYAML, oneSymbol) {
|
|||
std::unique_ptr<NormalizedFile> f = fromYAML(
|
||||
"---\n"
|
||||
"arch: x86_64\n"
|
||||
"file-type: object\n"
|
||||
"file-type: MH_OBJECT\n"
|
||||
"global-symbols:\n"
|
||||
" - name: _main\n"
|
||||
" type: N_SECT\n"
|
||||
|
@ -194,7 +194,7 @@ TEST(ObjectFileYAML, oneSection) {
|
|||
std::unique_ptr<NormalizedFile> f = fromYAML(
|
||||
"---\n"
|
||||
"arch: x86_64\n"
|
||||
"file-type: object\n"
|
||||
"file-type: MH_OBJECT\n"
|
||||
"sections:\n"
|
||||
" - segment: __TEXT\n"
|
||||
" section: __text\n"
|
||||
|
@ -228,7 +228,7 @@ TEST(ObjectFileYAML, hello_x86_64) {
|
|||
std::unique_ptr<NormalizedFile> f = fromYAML(
|
||||
"---\n"
|
||||
"arch: x86_64\n"
|
||||
"file-type: object\n"
|
||||
"file-type: MH_OBJECT\n"
|
||||
"flags: [ MH_SUBSECTIONS_VIA_SYMBOLS ]\n"
|
||||
"sections:\n"
|
||||
" - segment: __TEXT\n"
|
||||
|
@ -357,7 +357,7 @@ TEST(ObjectFileYAML, hello_x86) {
|
|||
std::unique_ptr<NormalizedFile> f = fromYAML(
|
||||
"---\n"
|
||||
"arch: x86\n"
|
||||
"file-type: object\n"
|
||||
"file-type: MH_OBJECT\n"
|
||||
"flags: [ MH_SUBSECTIONS_VIA_SYMBOLS ]\n"
|
||||
"sections:\n"
|
||||
" - segment: __TEXT\n"
|
||||
|
@ -486,7 +486,7 @@ TEST(ObjectFileYAML, hello_armv6) {
|
|||
std::unique_ptr<NormalizedFile> f = fromYAML(
|
||||
"---\n"
|
||||
"arch: armv6\n"
|
||||
"file-type: object\n"
|
||||
"file-type: MH_OBJECT\n"
|
||||
"flags: [ MH_SUBSECTIONS_VIA_SYMBOLS ]\n"
|
||||
"sections:\n"
|
||||
" - segment: __TEXT\n"
|
||||
|
@ -616,7 +616,7 @@ TEST(ObjectFileYAML, hello_armv7) {
|
|||
std::unique_ptr<NormalizedFile> f = fromYAML(
|
||||
"---\n"
|
||||
"arch: armv7\n"
|
||||
"file-type: object\n"
|
||||
"file-type: MH_OBJECT\n"
|
||||
"flags: [ MH_SUBSECTIONS_VIA_SYMBOLS ]\n"
|
||||
"sections:\n"
|
||||
" - segment: __TEXT\n"
|
||||
|
|
Loading…
Reference in New Issue