2009-09-24 14:23:57 +08:00
|
|
|
//===- not.cpp - The 'not' testing tool -----------------------------------===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2010-11-30 02:16:10 +08:00
|
|
|
#include "llvm/Support/Path.h"
|
|
|
|
#include "llvm/Support/Program.h"
|
2010-10-30 04:20:29 +08:00
|
|
|
#include "llvm/Support/raw_ostream.h"
|
2009-09-24 14:23:57 +08:00
|
|
|
using namespace llvm;
|
|
|
|
|
|
|
|
int main(int argc, const char **argv) {
|
|
|
|
sys::Path Program = sys::Program::FindProgramByName(argv[1]);
|
2010-10-30 04:20:29 +08:00
|
|
|
|
|
|
|
std::string ErrMsg;
|
|
|
|
int Result = sys::Program::ExecuteAndWait(Program, argv + 1, 0, 0, 0, 0,
|
|
|
|
&ErrMsg);
|
|
|
|
if (Result < 0) {
|
|
|
|
errs() << "Error: " << ErrMsg << "\n";
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
return Result == 0;
|
2009-09-24 14:23:57 +08:00
|
|
|
}
|