llvm-for-llvmta/tools/clang/test/CXX/cpp/cpp.predefined/p2.cpp

18 lines
557 B
C++
Raw Normal View History

2022-04-25 13:02:35 +02:00
// RUN: split-file %s %t.dir
// RUN: %clang_cc1 -verify %t.dir/defined.cpp
// RUN: %clang_cc1 -verify -mthread-model posix %t.dir/defined.cpp
// RUN: %clang_cc1 -verify -mthread-model single %t.dir/not-defined.cpp
// RUN: %clang_cc1 -verify -x c %t.dir/not-defined.cpp
//--- defined.cpp
// expected-no-diagnostics
#ifndef __STDCPP_THREADS__
#error __STDCPP_THREADS__ is not defined in posix thread model.
#endif
//--- not-defined.cpp
// expected-no-diagnostics
#ifdef __STDCPP_THREADS__
#error __STDCPP_THREADS__ is defined in single thread model.
#endif