]>
Commit | Line | Data |
---|---|---|
46e113bf CF |
1 | // { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } |
2 | // { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } | |
3 | // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } | |
4 | // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } | |
5 | // { dg-require-cstdint "" } | |
6 | // { dg-require-gthreads "" } | |
959d14e1 | 7 | // { dg-require-sched-yield "" } |
46e113bf | 8 | |
959d14e1 | 9 | // Copyright (C) 2008, 2009 Free Software Foundation, Inc. |
46e113bf CF |
10 | // |
11 | // This file is part of the GNU ISO C++ Library. This library is free | |
12 | // software; you can redistribute it and/or modify it under the | |
13 | // terms of the GNU General Public License as published by the | |
14 | // Free Software Foundation; either version 2, or (at your option) | |
15 | // any later version. | |
16 | ||
17 | // This library is distributed in the hope that it will be useful, | |
18 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | |
19 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
20 | // GNU General Public License for more details. | |
21 | ||
22 | // You should have received a copy of the GNU General Public License along | |
23 | // with this library; see the file COPYING. If not, write to the Free | |
24 | // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, | |
25 | // USA. | |
26 | ||
27 | // As a special exception, you may use this file as part of a free software | |
28 | // library without restriction. Specifically, if other files instantiate | |
29 | // templates or use macros or inline functions from this file, or you compile | |
30 | // this file and link it with other files to produce an executable, this | |
31 | // file does not by itself cause the resulting executable to be covered by | |
32 | // the GNU General Public License. This exception does not however | |
33 | // invalidate any other reasons why the executable file might be covered by | |
34 | // the GNU General Public License. | |
35 | ||
36 | #include <thread> | |
37 | #include <system_error> | |
38 | #include <testsuite_hooks.h> | |
39 | ||
40 | int main() | |
41 | { | |
42 | bool test __attribute__((unused)) = true; | |
43 | ||
44 | try | |
45 | { | |
46 | std::this_thread::yield(); | |
47 | } | |
48 | catch (const std::system_error&) | |
49 | { | |
50 | VERIFY( false ); | |
51 | } | |
52 | catch (...) | |
53 | { | |
54 | VERIFY( false ); | |
55 | } | |
56 | ||
57 | return 0; | |
58 | } |