Plan 9 from Bell Labs’s /usr/web/sources/contrib/fernan/nhc98/src/cpphs/tests/chains

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


For this test, assume that all of e,f,g,h are defined.
Also that c,d are defined, a,b are not.
If cpphs does operator precedence wrongly in infix chains, the final
conditional will be interpreted wrongly.

#if defined(a) || defined(b) || defined(c) || defined(d)
chained || OK
#endif
#if defined(e) && defined(f) && defined(g) && defined(h)
chained && OK
#endif
#if defined(a) && defined(b) || defined(c) && defined(d)
mixed chain of || and && OK
#else
mixed chain of || and && BROKEN
#endif

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.