[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / clang / test / C / C99 / n617.c
blobbe263cc05f3e8bc2fd46ac5fff007af8b67c5937
1 // RUN: %clang_cc1 -verify %s
3 // expected-no-diagnostics
5 /* WG14 N617: yes
6 * reliable integer division
7 */
8 void test(void) {
9 _Static_assert(59 / 4 == 14, "we didn't truncate properly");
10 _Static_assert(59 / -4 == -14, "we didn't truncate properly");
11 _Static_assert(-59 / 4 == -14, "we didn't truncate properly");
12 _Static_assert(-59 / -4 == 14, "we didn't truncate properly");
14 // Might as well test % for the quotient.
15 _Static_assert(59 % 4 == 3, "we didn't truncate properly");
16 _Static_assert(59 % -4 == 3, "we didn't truncate properly");
17 _Static_assert(-59 % 4 == -3, "we didn't truncate properly");
18 _Static_assert(-59 % -4 == -3, "we didn't truncate properly");
20 // Test the idiom for rounding up.
21 _Static_assert((59 + (4 - 1)) / 4 == 15, "failed to 'round up' with the usual idiom");
22 _Static_assert((59 + (4 - 1)) % 4 == 2, "failed to 'round up' with the usual idiom");