Skip to content

Commit

Permalink
[Clang] Fix compare-record.c test on s390x (NFC)
Browse files Browse the repository at this point in the history
s390x looks through pointers when determining the "externally
visible vector ABI". For that reason, the test shows different
behavior just on that platform.

Adjust the test in the reverse direction of what I originall did:
Make sure that the type behind the pointer is always queried, by
dereferencing the pointer.
  • Loading branch information
nikic committed Jun 16, 2023
1 parent d065adc commit 835cdcb
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions clang/test/Modules/compare-record.c
Original file line number Diff line number Diff line change
Expand Up @@ -423,10 +423,13 @@ struct CompareDifferentFieldInIndirectStruct compareIndirectStruct;
// expected-error@second-nested-struct.h:* {{'IndirectStruct::mismatchingField' from module 'Second' is not present in definition of 'struct IndirectStruct' in module 'First.Hidden'}}
// expected-note@first-nested-struct.h:* {{declaration of 'mismatchingField' does not match}}
#elif defined(CASE3)
// This currently doesn't produce an error, because there is no dependency
// on the layout of DirectStruct.
// expected-no-diagnostics
// expected-error@second-nested-struct.h:* {{'IndirectStruct::mismatchingField' from module 'Second' is not present in definition of 'struct IndirectStruct' in module 'First.Hidden'}}
// expected-note@first-nested-struct.h:* {{declaration of 'mismatchingField' does not match}}
struct CompareIndirectStructPointer compareIndirectStructPointer;
struct DirectStruct test() {
// Make sure the type behind the pointer is inspected.
return *compareIndirectStructPointer.directFieldPointer;
}
#endif

//--- include/first-anonymous.h
Expand Down

0 comments on commit 835cdcb

Please sign in to comment.