2009-09-24 06:23:57 +00: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-29 18:16:10 +00:00
|
|
|
#include "llvm/Support/Path.h"
|
|
|
|
#include "llvm/Support/Program.h"
|
2010-10-29 20:20:29 +00:00
|
|
|
#include "llvm/Support/raw_ostream.h"
|
2009-09-24 06:23:57 +00:00
|
|
|
using namespace llvm;
|
|
|
|
|
|
|
|
int main(int argc, const char **argv) {
|
|
|
|
sys::Path Program = sys::Program::FindProgramByName(argv[1]);
|
2010-10-29 20:20:29 +00: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 06:23:57 +00:00
|
|
|
}
|