Skip to content

Commit

Permalink
[NFC][clang] add extra member-alignment testcase
Browse files Browse the repository at this point in the history
for when an alignment attribute is used. This will be useful for D147184 to demonstrate what changes.
  • Loading branch information
daltenty committed Jul 5, 2023
1 parent a57236d commit cf08c10
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions clang/test/CodeGenCXX/member-alignment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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@t@@QEAAXXZ"({{.*}}) #0 align 16 {
}

void
t::bar(void) {
// CHECK-ITANIUM: @_ZN1t3barEv({{.*}}) #0 align 2 {
Expand Down

0 comments on commit cf08c10

Please sign in to comment.