[ASan] Update sanitizer_common and asan test_util headers to support building on...
[blocksruntime.git] / lib / sanitizer_common / tests / sanitizer_nolibc_test.cc
blobd0d5a5e138985a90ab62812b391a199830834fc1
1 //===-- sanitizer_nolibc_test.cc ------------------------------------------===//
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 //===----------------------------------------------------------------------===//
9 //
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"
19 #include <stdlib.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));
31 #endif