mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-07-08 18:30:04 +00:00
Revert r197600 while I sort out why it's failing on Windows.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197602 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
04946d54db
commit
4fc184584c
@ -1,53 +0,0 @@
|
|||||||
//===- llvm/unittest/ArchiveFileDescriptor/ArchiveFileDescriptor.cpp ------===//
|
|
||||||
//
|
|
||||||
// The LLVM Compiler Infrastructure
|
|
||||||
//
|
|
||||||
// This file is distributed under the University of Illinois Open Source
|
|
||||||
// License. See LICENSE.TXT for details.
|
|
||||||
//
|
|
||||||
//===----------------------------------------------------------------------===//
|
|
||||||
|
|
||||||
#include "llvm/Object/Archive.h"
|
|
||||||
#include "llvm/Object/ObjectFile.h"
|
|
||||||
#include "llvm/Support/MemoryBuffer.h"
|
|
||||||
#include "gtest/gtest.h"
|
|
||||||
|
|
||||||
using namespace llvm;
|
|
||||||
using namespace llvm::object;
|
|
||||||
|
|
||||||
static void failIfError(error_code EC) {
|
|
||||||
if (!EC)
|
|
||||||
return;
|
|
||||||
|
|
||||||
errs() << "ERROR: " << EC.message() << "\n";
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST(ArchiveFileDescriptor, Test1) {
|
|
||||||
int FD;
|
|
||||||
|
|
||||||
error_code EC = sys::fs::openFileForRead("ArchiveFileDescriptor", FD);
|
|
||||||
failIfError(EC);
|
|
||||||
|
|
||||||
OwningPtr<MemoryBuffer> MemoryBuffer;
|
|
||||||
EC = MemoryBuffer::getOpenFile(FD, "Dummy Filename",
|
|
||||||
MemoryBuffer,
|
|
||||||
/* FileSize */ -1,
|
|
||||||
/* RequiresNullTerminator */ false);
|
|
||||||
failIfError(EC);
|
|
||||||
|
|
||||||
// Attempt to open the binary.
|
|
||||||
OwningPtr<Binary> Binary;
|
|
||||||
EC = createBinary(MemoryBuffer.take(), Binary);
|
|
||||||
failIfError(EC);
|
|
||||||
|
|
||||||
if (Archive *Arc = dyn_cast<Archive>(Binary.get())) {
|
|
||||||
(void)Arc;
|
|
||||||
errs() << "ERROR: Loaded archive, was expecting object file\n";
|
|
||||||
} else if (ObjectFile *Obj = dyn_cast<ObjectFile>(Binary.get())) {
|
|
||||||
(void)Obj;
|
|
||||||
} else {
|
|
||||||
outs() << "ERROR: Unknown file type\n";
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,8 +0,0 @@
|
|||||||
set(LLVM_LINK_COMPONENTS
|
|
||||||
Object
|
|
||||||
Support
|
|
||||||
)
|
|
||||||
|
|
||||||
add_llvm_unittest(ArchiveFileDescriptor
|
|
||||||
ArchiveFileDescriptor.cpp
|
|
||||||
)
|
|
@ -1,15 +0,0 @@
|
|||||||
##===- unittests/ArchiveFileDescriptor/Makefile ------------*- Makefile -*-===##
|
|
||||||
#
|
|
||||||
# The LLVM Compiler Infrastructure
|
|
||||||
#
|
|
||||||
# This file is distributed under the University of Illinois Open Source
|
|
||||||
# License. See LICENSE.TXT for details.
|
|
||||||
#
|
|
||||||
##===----------------------------------------------------------------------===##
|
|
||||||
|
|
||||||
LEVEL = ../..
|
|
||||||
TESTNAME = ArchiveFileDescriptor
|
|
||||||
LINK_COMPONENTS := object
|
|
||||||
|
|
||||||
include $(LEVEL)/Makefile.config
|
|
||||||
include $(LLVM_SRC_ROOT)/unittests/Makefile.unittest
|
|
@ -7,7 +7,6 @@ endfunction()
|
|||||||
|
|
||||||
add_subdirectory(ADT)
|
add_subdirectory(ADT)
|
||||||
add_subdirectory(Analysis)
|
add_subdirectory(Analysis)
|
||||||
add_subdirectory(ArchiveFileDescriptor)
|
|
||||||
add_subdirectory(Bitcode)
|
add_subdirectory(Bitcode)
|
||||||
add_subdirectory(CodeGen)
|
add_subdirectory(CodeGen)
|
||||||
add_subdirectory(DebugInfo)
|
add_subdirectory(DebugInfo)
|
||||||
|
@ -9,8 +9,8 @@
|
|||||||
|
|
||||||
LEVEL = ..
|
LEVEL = ..
|
||||||
|
|
||||||
PARALLEL_DIRS = ADT Analysis ArchiveFileDescriptor Bitcode CodeGen DebugInfo \
|
PARALLEL_DIRS = ADT Analysis Bitcode CodeGen DebugInfo ExecutionEngine IR \
|
||||||
ExecutionEngine IR MC Object Option Support Transforms
|
MC Object Option Support Transforms
|
||||||
|
|
||||||
include $(LEVEL)/Makefile.common
|
include $(LEVEL)/Makefile.common
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user