1 //===-- sanitizer_nolibc_test.cc ------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file is a part of ThreadSanitizer/AddressSanitizer runtime.
11 // Tests for libc independence of sanitizer_common.
13 //===----------------------------------------------------------------------===//
15 #include "sanitizer_common/sanitizer_platform.h"
17 #include "gtest/gtest.h"
21 extern const char *argv0;
23 #if SANITIZER_LINUX && defined(__x86_64__)
24 TEST(SanitizerCommon, NolibcMain) {
25 std::string NolibcTestPath = argv0;
26 NolibcTestPath += "-Nolibc";
27 int status = system(NolibcTestPath.c_str());
28 EXPECT_EQ(true, WIFEXITED(status));
29 EXPECT_EQ(0, WEXITSTATUS(status));