[clang] cf08c10 - [NFC][clang] add extra member-alignment testcase

David Tenty via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 5 13:44:32 PDT 2023


Author: David Tenty
Date: 2023-07-05T16:44:05-04:00
New Revision: cf08c103266b7ee59cbc2352c4d20f27472cb257

URL: https://github.com/llvm/llvm-project/commit/cf08c103266b7ee59cbc2352c4d20f27472cb257
DIFF: https://github.com/llvm/llvm-project/commit/cf08c103266b7ee59cbc2352c4d20f27472cb257.diff

LOG: [NFC][clang] add extra member-alignment testcase

for when an alignment attribute is used. This will be useful for D147184 to demonstrate what changes.

Added: 
    

Modified: 
    clang/test/CodeGenCXX/member-alignment.cpp

Removed: 
    


################################################################################
diff  --git a/clang/test/CodeGenCXX/member-alignment.cpp b/clang/test/CodeGenCXX/member-alignment.cpp
index ff6bb442b8470d..72f992ffe8f980 100644
--- a/clang/test/CodeGenCXX/member-alignment.cpp
+++ b/clang/test/CodeGenCXX/member-alignment.cpp
@@ -11,8 +11,19 @@ class t {
 public:
   virtual void foo(void);
   void bar(void);
+  void baz(void);
 };
 
+// The original alignment is observed if >=2, regardless of any extra alignment
+// of member functions.
+[[gnu::aligned(16)]]
+void
+t::baz(void) {
+// CHECK-NOEXTRAALIGN: @_ZN1t3bazEv({{.*}}) #0 align 16 {
+// CHECK-EXTRAALIGN: @_ZN1t3bazEv({{.*}}) #0 align 16 {
+// CHECK-MSVC: @"?baz at t@@QEAAXXZ"({{.*}}) #0 align 16 {
+}
+
 void
 t::bar(void) {
 // CHECK-ITANIUM: @_ZN1t3barEv({{.*}}) #0 align 2 {


        


More information about the cfe-commits mailing list