1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
crate::ix!();
//-------------------------------------------[.cpp/bitcoin/src/test/compilerbug_tests.cpp]
#[cfg(__GNUC__)]
#[cfg(test)]
pub mod compilerbug_tests {
/**
| This block will also be built under clang,
| which is fine (as it supports noinline)
|
*/
#[inline(never)] pub fn set_one(ptr: *mut u8) {
todo!();
/*
*ptr = 1;
*/
}
#[inline(never)] pub fn check_zero(
in_: *const u8,
len: u32) -> i32 {
todo!();
/*
for (unsigned int i = 0; i < len; ++i) {
if (in[i] != 0) return 0;
}
return 1;
*/
}
pub fn set_one_on_stack() {
todo!();
/*
unsigned char buf[1];
set_one(buf);
*/
}
#[test] fn gccbug_90348() {
todo!();
/*
// Test for GCC bug 90348. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90348
for (int i = 0; i <= 4; ++i) {
unsigned char in[4];
for (int j = 0; j < i; ++j) {
in[j] = 0;
set_one_on_stack(); // Apparently modifies in[0]
}
BOOST_CHECK(check_zero(in, i));
}
*/
}
}