mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-28 13:06:07 +00:00

According to https://eel.is/c++draft/cpp.predefined#2.6, `__STDCPP_THREADS__` is a predefined macro. Differential Revision: https://reviews.llvm.org/D91747
18 lines
557 B
C++
18 lines
557 B
C++
// 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
|