[clang] [X86] [iamcu] Fix wrong alignment value for attr (aligned) with -miamcu (PR #80401)

Phoebe Wang via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 2 04:53:15 PST 2024


================
@@ -1,4 +1,12 @@
 // RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -triple i586-intel-elfiamcu -fsyntax-only -verify %s
+
+#ifdef __iamcu
+// expected-no-diagnostics
+struct dummy { int x __attribute__((aligned));  };
+int m0[__alignof__(struct dummy) == 4 ? 1 : -1];
+
+#else
----------------
phoebewang wrote:

Maybe only change line 15 and keep others test for iamcu too, e.g.,

```
 short g0[3] __attribute__((aligned));
+ #ifdef __iamcu
+ short g0_chk[__alignof__(g0) == 4 ? 1 : -1];
+ #else
 short g0_chk[__alignof__(g0) == 16 ? 1 : -1];
+ #endif
```

https://github.com/llvm/llvm-project/pull/80401


More information about the cfe-commits mailing list