[PATCH] Skip tests requiring "alignof (void)" when compiling using clang

Simon Marchi simark@simark.ca
Thu Jul 2 20:52:45 GMT 2020


On 2020-07-02 4:49 p.m., Pedro Alves wrote:
> I think this should still test GDB's support.  And a
> comment would be helpful.  Like:
> 
> # As an extension, GCC allows void pointer arithmetic, with
> # sizeof(void) and alignof(void) both 1.  GDB supports GCC's
> # extension.  Clang does not.
> if ![test_compiler_info clang*] {
>     set expected [get_integer_valueof a_void 0]
>     gdb_test "print alignof(void)" " = $expected"
> } else {
>     gdb_test "print alignof(void)" " = 1"
> }

Indeed.  Otherwise, let's say that clang gain this feature, it would remain untested
(when testing with clang) and nobody would think of coming here to update the test
case.  Here, if clang gains the feature, then I suppose it would generate a FAIL,
which would prompt us to update the test case.

Simon


More information about the Gdb-patches mailing list