1 //===-- sanitizer_nolibc_test.cpp -----------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // This file is a part of ThreadSanitizer/AddressSanitizer runtime.
10 // Tests for libc independence of sanitizer_common.
12 //===----------------------------------------------------------------------===//
14 #include "sanitizer_common/sanitizer_platform.h"
16 #include "gtest/gtest.h"
20 extern const char *argv0
;
22 #if SANITIZER_LINUX && defined(__x86_64__)
23 TEST(SanitizerCommon
, NolibcMain
) {
24 std::string NolibcTestPath
= argv0
;
25 NolibcTestPath
+= "-Nolibc";
26 int status
= system(NolibcTestPath
.c_str());
27 EXPECT_EQ(true, WIFEXITED(status
));
28 EXPECT_EQ(0, WEXITSTATUS(status
));