Skip to content

Commit 2841c2c

Browse files
author
Daniel Kroening
committed
fix tests for diverse targets
1 parent 46393fe commit 2841c2c

File tree

2 files changed

+9
-5
lines changed
  • regression/ansi-c

2 files changed

+9
-5
lines changed

regression/ansi-c/gcc_attributes5/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ STATIC_ASSERT(__alignof(var2)==8);
1616
STATIC_ASSERT(__alignof(var3)==8);
1717
STATIC_ASSERT(__alignof(var4)==8);
1818
STATIC_ASSERT(__alignof(var5)==8);
19-
STATIC_ASSERT(__alignof(var6)==8);
19+
STATIC_ASSERT(__alignof(var6)==__alignof(void *));
2020
STATIC_ASSERT(__alignof(var7)==8);
2121

2222
void (__attribute__((aligned)) *****f1)(void);

regression/ansi-c/gcc_types_compatible_p3/main.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,17 @@ STATIC_ASSERT(__builtin_types_compatible_p(typeof(enum unsigned_enum), unsigned
3737

3838
// The enum gets bigger as required, but note that the constant is now unsigned.
3939
enum large_enum1 { LARGE_CONSTANT1=0x100000000 };
40-
STATIC_ASSERT(__builtin_types_compatible_p(typeof(LARGE_CONSTANT1), unsigned long));
41-
STATIC_ASSERT(__builtin_types_compatible_p(typeof(enum large_enum1), unsigned long));
40+
STATIC_ASSERT(__builtin_types_compatible_p(typeof(LARGE_CONSTANT1), unsigned long) ||
41+
__builtin_types_compatible_p(typeof(LARGE_CONSTANT1), unsigned long long));
42+
STATIC_ASSERT(__builtin_types_compatible_p(typeof(enum large_enum1), unsigned long) ||
43+
__builtin_types_compatible_p(typeof(enum large_enum1), unsigned long long));
4244

4345
// Also works when signed
4446
enum large_enum2 { NEG=-1, LARGE_CONSTANT2=0x100000000 };
45-
STATIC_ASSERT(__builtin_types_compatible_p(typeof(LARGE_CONSTANT2), signed long));
46-
STATIC_ASSERT(__builtin_types_compatible_p(typeof(enum large_enum2), signed long));
47+
STATIC_ASSERT(__builtin_types_compatible_p(typeof(LARGE_CONSTANT2), signed long) ||
48+
__builtin_types_compatible_p(typeof(LARGE_CONSTANT2), signed long long));
49+
STATIC_ASSERT(__builtin_types_compatible_p(typeof(enum large_enum2), signed long) ||
50+
__builtin_types_compatible_p(typeof(enum large_enum2), signed long long));
4751

4852
// 'Packed' is interesting.
4953
enum __attribute__((packed)) packed_enum1 { POS_PACKED=1 };

0 commit comments

Comments
 (0)