Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/gcc.c-torture/execute/pr92140.c @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
131:84e7813d76e9 | 145:1830386684a0 |
---|---|
1 /* PR target/92140 */ | |
2 | |
3 char c; | |
4 int v; | |
5 | |
6 __attribute__((noipa)) void f1 (void) { v += c != 0; } | |
7 __attribute__((noipa)) void f2 (void) { v -= c != 0; } | |
8 __attribute__((noipa)) void f3 (void) { v += c == 0; } | |
9 __attribute__((noipa)) void f4 (void) { v -= c == 0; } | |
10 __attribute__((noipa)) void f5 (void) { v += (c != 0) - 26; } | |
11 __attribute__((noipa)) void f6 (void) { v -= (c != 0) - 26; } | |
12 __attribute__((noipa)) void f7 (void) { v += (c == 0) - 26; } | |
13 __attribute__((noipa)) void f8 (void) { v -= (c == 0) - 26; } | |
14 __attribute__((noipa)) void f9 (void) { v += (c != 0) + 42; } | |
15 __attribute__((noipa)) void f10 (void) { v -= (c != 0) + 42; } | |
16 __attribute__((noipa)) void f11 (void) { v += (c == 0) + 42; } | |
17 __attribute__((noipa)) void f12 (void) { v -= (c == 0) + 42; } | |
18 __attribute__((noipa)) void f13 (int z) { v += (c == 0) + z; } | |
19 __attribute__((noipa)) void f14 (int z) { v -= (c == 0) + z; } | |
20 __attribute__((noipa)) unsigned int f15 (unsigned int n) { return n ? 2 : 1; } | |
21 | |
22 int | |
23 main () | |
24 { | |
25 int i; | |
26 for (i = 0; i < 2; i++) | |
27 { | |
28 v = 15; | |
29 if (i == 1) | |
30 c = 37; | |
31 f1 (); | |
32 if (v != 15 + i) | |
33 __builtin_abort (); | |
34 f2 (); | |
35 if (v != 15) | |
36 __builtin_abort (); | |
37 f3 (); | |
38 if (v != 16 - i) | |
39 __builtin_abort (); | |
40 f4 (); | |
41 if (v != 15) | |
42 __builtin_abort (); | |
43 f5 (); | |
44 if (v != 15 + i - 26) | |
45 __builtin_abort (); | |
46 f6 (); | |
47 if (v != 15) | |
48 __builtin_abort (); | |
49 f7 (); | |
50 if (v != 16 - i - 26) | |
51 __builtin_abort (); | |
52 f8 (); | |
53 if (v != 15) | |
54 __builtin_abort (); | |
55 f9 (); | |
56 if (v != 15 + i + 42) | |
57 __builtin_abort (); | |
58 f10 (); | |
59 if (v != 15) | |
60 __builtin_abort (); | |
61 f11 (); | |
62 if (v != 16 - i + 42) | |
63 __builtin_abort (); | |
64 f12 (); | |
65 if (v != 15) | |
66 __builtin_abort (); | |
67 f13 (173); | |
68 if (v != 16 - i + 173) | |
69 __builtin_abort (); | |
70 f14 (173); | |
71 if (v != 15) | |
72 __builtin_abort (); | |
73 f13 (-35); | |
74 if (v != 16 - i - 35) | |
75 __builtin_abort (); | |
76 f14 (-35); | |
77 if (v != 15) | |
78 __builtin_abort (); | |
79 } | |
80 if (f15 (0) != 1 || f15 (1) != 2 || f15 (371) != 2) | |
81 __builtin_abort (); | |
82 return 0; | |
83 } |