================
@@ -0,0 +1,64 @@
+// RUN: %clang_cc1 -fsyntax-only -triple x86_64-linux-gnu -fpack-struct=1
-DPACK_STRUCT -verify=pack-struct %s
+// RUN: %clang_cc1 -fsyntax-only -triple i386-apple-darwin -DMAC68K
-verify=mac68k %s
+// RUN: %clang_cc1 -fsyntax-only -triple x86_64-linux-gnu -target-feature
+avx512f -DPACK16 -verify=itanium %s
+// RUN: %clang_cc1 -fsyntax-only -triple x86_64-windows-msvc -target-feature
+avx512f -DPACK16 -verify=ms %s
+
+extern void f1(int *);
+
+#ifdef PACK_STRUCT
+struct S {
+ char c;
+ int x;
+};
+
+void g0(struct S *p) {
+ f1(&p->x); // pack-struct-warning {{packed member 'x' of class or structure
'S'}}
----------------
mattst88 wrote:
The full text is "taking address of packed member 'x' of class or structure 'S'
may result in an unaligned pointer value". The tests match a substring. "packed
member" is now inaccurate for the typedef case, and I'd rather fix that in a
separate PR, if that's alright with you.
https://github.com/llvm/llvm-project/pull/219096
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits