]>
git.ipfire.org Git - thirdparty/gcc.git/blob - libstdc++-v3/testsuite/30_threads/async/launch.cc
2 // { dg-additional-options "-pthread" { target pthread } }
3 // { dg-require-effective-target c++11 }
4 // { dg-require-gthreads "" }
6 // Copyright (C) 2011-2024 Free Software Foundation, Inc.
8 // This file is part of the GNU ISO C++ Library. This library is free
9 // software; you can redistribute it and/or modify it under the
10 // terms of the GNU General Public License as published by the
11 // Free Software Foundation; either version 3, or (at your option)
14 // This library is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 // GNU General Public License for more details.
19 // You should have received a copy of the GNU General Public License along
20 // with this library; see the file COPYING3. If not see
21 // <http://www.gnu.org/licenses/>.
25 #include <testsuite_hooks.h>
32 const launch both
= launch::async
|launch::deferred
;
33 const launch all
= ~none
;
35 VERIFY( (none
& both
) == none
);
36 VERIFY( (none
| both
) == both
);
37 VERIFY( (none
^ both
) == both
);
39 VERIFY( (none
& all
) == none
);
40 VERIFY( (none
| all
) == all
);
41 VERIFY( (none
^ all
) == all
);
43 VERIFY( (both
& all
) == both
);
44 VERIFY( (both
| all
) == all
);
45 VERIFY( (both
^ all
) == ~both
);
47 VERIFY( (none
& launch::async
) == none
);
48 VERIFY( (none
& launch::deferred
) == none
);
50 VERIFY( (none
| launch::async
) == launch::async
);
51 VERIFY( (none
| launch::deferred
) == launch::deferred
);
53 VERIFY( (none
^ launch::async
) == launch::async
);
54 VERIFY( (none
^ launch::deferred
) == launch::deferred
);
56 VERIFY( (none
& none
) == none
);
57 VERIFY( (none
| none
) == none
);
58 VERIFY( (none
^ none
) == none
);
60 VERIFY( (both
& both
) == both
);
61 VERIFY( (both
| both
) == both
);
62 VERIFY( (both
^ both
) == none
);
64 VERIFY( (all
& all
) == all
);
65 VERIFY( (all
| all
) == all
);
66 VERIFY( (all
^ all
) == none
);