zpu: managed to compile program that writes constant to global variable
[llvm/zpu.git] / utils / not / not.cpp
blob908abe932d10591b38b05fd66f9f07c906b62e19
1 //===- not.cpp - The 'not' testing tool -----------------------------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
10 #include "llvm/System/Path.h"
11 #include "llvm/System/Program.h"
12 #include "llvm/Support/raw_ostream.h"
13 using namespace llvm;
15 int main(int argc, const char **argv) {
16 sys::Path Program = sys::Program::FindProgramByName(argv[1]);
18 std::string ErrMsg;
19 int Result = sys::Program::ExecuteAndWait(Program, argv + 1, 0, 0, 0, 0,
20 &ErrMsg);
21 if (Result < 0) {
22 errs() << "Error: " << ErrMsg << "\n";
23 return 1;
26 return Result == 0;