191586Smarkm//===-- sanitizer_nolibc_test.cc ------------------------------------------===//
212099Sjoerg//
312099Sjoerg//                     The LLVM Compiler Infrastructure
491586Smarkm//
512099Sjoerg// This file is distributed under the University of Illinois Open Source
612099Sjoerg// License. See LICENSE.TXT for details.
712099Sjoerg//
812099Sjoerg//===----------------------------------------------------------------------===//
912099Sjoerg//
1012099Sjoerg// This file is a part of ThreadSanitizer/AddressSanitizer runtime.
1112099Sjoerg// Tests for libc independence of sanitizer_common.
1212099Sjoerg//
1312099Sjoerg//===----------------------------------------------------------------------===//
1412099Sjoerg
1512099Sjoerg#include "sanitizer_common/sanitizer_platform.h"
1612099Sjoerg
1712099Sjoerg#include "gtest/gtest.h"
1812099Sjoerg
1912099Sjoerg#include <stdlib.h>
2012099Sjoerg
2112099Sjoergextern const char *argv0;
2212099Sjoerg
2312099Sjoerg#if SANITIZER_LINUX && defined(__x86_64__)
2412099SjoergTEST(SanitizerCommon, NolibcMain) {
2512099Sjoerg  std::string NolibcTestPath = argv0;
2612099Sjoerg  NolibcTestPath += "-Nolibc";
2712099Sjoerg  int status = system(NolibcTestPath.c_str());
2812099Sjoerg  EXPECT_EQ(true, WIFEXITED(status));
2912099Sjoerg  EXPECT_EQ(0, WEXITSTATUS(status));
3012099Sjoerg}
3112099Sjoerg#endif
3212099Sjoerg