Skip to content

Commit 835cdcb

Browse files
committed
[Clang] Fix compare-record.c test on s390x (NFC)
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.
1 parent d065adc commit 835cdcb

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

clang/test/Modules/compare-record.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -423,10 +423,13 @@ struct CompareDifferentFieldInIndirectStruct compareIndirectStruct;
423423
// [email protected]:* {{'IndirectStruct::mismatchingField' from module 'Second' is not present in definition of 'struct IndirectStruct' in module 'First.Hidden'}}
424424
// [email protected]:* {{declaration of 'mismatchingField' does not match}}
425425
#elif defined(CASE3)
426-
// This currently doesn't produce an error, because there is no dependency
427-
// on the layout of DirectStruct.
428-
// expected-no-diagnostics
426+
// [email protected]:* {{'IndirectStruct::mismatchingField' from module 'Second' is not present in definition of 'struct IndirectStruct' in module 'First.Hidden'}}
427+
// [email protected]:* {{declaration of 'mismatchingField' does not match}}
429428
struct CompareIndirectStructPointer compareIndirectStructPointer;
429+
struct DirectStruct test() {
430+
// Make sure the type behind the pointer is inspected.
431+
return *compareIndirectStructPointer.directFieldPointer;
432+
}
430433
#endif
431434

432435
//--- include/first-anonymous.h

0 commit comments

Comments
 (0)