Skip to content

Commit 96a5c0d

Browse files
committed
Remove the bitfield-in-union test, for now
1 parent 9cf18cd commit 96a5c0d

File tree

2 files changed

+0
-52
lines changed

2 files changed

+0
-52
lines changed

Lib/test/test_ctypes/test_generated_structs.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -161,22 +161,6 @@ class MSStraddlingExample(Structure):
161161
('may_straddle', c_uint, 30),
162162
('last', c_uint, 18)]
163163

164-
@register()
165-
class BitsfieldUnion(Union):
166-
# Note that if the bit fields are changed to `c_int`,
167-
# the alignment is unclear:
168-
# MSC reports 1 but GCC with __attribute__((ms_struct)) gives 4.
169-
_fields_ = [("A", c_int8, 1),
170-
("B", c_int8, 2),
171-
("C", c_int8, 3),
172-
("D", c_int8, 4),
173-
("E", c_int8, 5),
174-
("F", c_int8, 6),
175-
("G", c_int8, 7),
176-
("H", c_int8, 8),
177-
# ("I", c_int, 9),
178-
("not_a_bitfield", c_int8)]
179-
180164
@register()
181165
class IntBits(Structure):
182166
_fields_ = [("A", c_int, 1),

Modules/_ctypes/_ctypes_test_generated.c.h

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -362,42 +362,6 @@
362362
return result;
363363
}
364364

365-
if (PyUnicode_CompareWithASCIIString(name, "BitsfieldUnion") == 0) {
366-
367-
#if (!defined(__xlc__))
368-
369-
union BitsfieldUnion {
370-
int8_t A :1;
371-
int8_t B :2;
372-
int8_t C :3;
373-
int8_t D :4;
374-
int8_t E :5;
375-
int8_t F :6;
376-
int8_t G :7;
377-
int8_t H :8;
378-
int8_t not_a_bitfield;
379-
};
380-
union BitsfieldUnion value = {0};
381-
APPEND(PyUnicode_FromString("BitsfieldUnion"));
382-
APPEND(PyLong_FromLong(sizeof(union BitsfieldUnion)));
383-
APPEND(PyLong_FromLong(_Alignof(union BitsfieldUnion)));
384-
TEST_FIELD(int8_t, value.A);
385-
TEST_FIELD(int8_t, value.B);
386-
TEST_FIELD(int8_t, value.C);
387-
TEST_FIELD(int8_t, value.D);
388-
TEST_FIELD(int8_t, value.E);
389-
TEST_FIELD(int8_t, value.F);
390-
TEST_FIELD(int8_t, value.G);
391-
TEST_FIELD(int8_t, value.H);
392-
TEST_FIELD(int8_t, value.not_a_bitfield);
393-
#else
394-
APPEND(Py_NewRef(Py_None));
395-
APPEND(PyUnicode_FromString("skipped on this compiler"));
396-
#endif
397-
398-
return result;
399-
}
400-
401365
if (PyUnicode_CompareWithASCIIString(name, "IntBits") == 0) {
402366

403367
struct IntBits {

0 commit comments

Comments
 (0)