]> git.ipfire.org Git - thirdparty/gcc.git/blame - libgomp/doc/the-libgomp-abi/implementing-sections-construct.rst
sphinx: add missing trailing newline
[thirdparty/gcc.git] / libgomp / doc / the-libgomp-abi / implementing-sections-construct.rst
CommitLineData
c63539ff
ML
1..
2 Copyright 1988-2022 Free Software Foundation, Inc.
3 This is part of the GCC manual.
4 For copying conditions, see the copyright.rst file.
5
6.. _implementing-sections-construct:
7
8Implementing SECTIONS construct
9*******************************
10
11A block as
12
13.. code-block:: c++
14
15 #pragma omp sections
16 {
17 #pragma omp section
18 stmt1;
19 #pragma omp section
20 stmt2;
21 #pragma omp section
22 stmt3;
23 }
24
25becomes
26
27.. code-block:: c++
28
29 for (i = GOMP_sections_start (3); i != 0; i = GOMP_sections_next ())
30 switch (i)
31 {
32 case 1:
33 stmt1;
34 break;
35 case 2:
36 stmt2;
37 break;
38 case 3:
39 stmt3;
40 break;
41 }
3ed1b4ce 42 GOMP_barrier ();