Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGenCXX / member-alignment.cpp
blob8e7a353dfe6f47d8ec16c3370602da4f4833f94a
1 // RUN: %clang_cc1 -emit-llvm -triple wasm32-unknown-unknown %s -o - | \
2 // RUN: FileCheck -check-prefix CHECK-NOEXTRAALIGN %s
3 // RUN: %clang_cc1 -emit-llvm -triple wasm64-unknown-unknown %s -o - | \
4 // RUN: FileCheck -check-prefix CHECK-NOEXTRAALIGN %s
5 // RUN: %clang_cc1 -emit-llvm -triple ppc64le-unknown-linux-gnu %s -o - | \
6 // RUN: FileCheck -check-prefix CHECK-NOEXTRAALIGN %s
7 // RUN: %clang_cc1 -emit-llvm -triple arm64-unknown-linux-gnu %s -o - | \
8 // RUN: FileCheck -check-prefix CHECK-EXTRAALIGN %s
9 // RUN: %clang_cc1 -emit-llvm -triple arm64-apple-ios %s -o - | \
10 // RUN: FileCheck -check-prefix CHECK-EXTRAALIGN %s
11 // RUN: %clang_cc1 -emit-llvm -triple aarch64-unknown-linux-gnu %s -o - | \
12 // RUN: FileCheck -check-prefix CHECK-EXTRAALIGN %s
13 // RUN: %clang_cc1 -emit-llvm -triple mips-unknown-linux-gnu %s -o - | \
14 // RUN: FileCheck -check-prefix CHECK-EXTRAALIGN %s
15 // RUN: %clang_cc1 -emit-llvm -triple x86_64-unknown-fuchsia %s -o - | \
16 // RUN: FileCheck -check-prefix CHECK-EXTRAALIGN %s
17 // RUN: %clang_cc1 -emit-llvm -triple powerpc-unknown-aix %s -o - | \
18 // RUN: FileCheck -check-prefix CHECK-NOEXTRAALIGN %s
19 // RUN: %clang_cc1 -emit-llvm -triple x86_64-unknown-windows-msvc %s -o - | \
20 // RUN: FileCheck -check-prefix CHECK-MSVC %s
22 class t {
23 public:
24 virtual void foo(void);
25 void bar(void);
26 void baz(void);
29 // The original alignment is observed if >=2, regardless of any extra alignment
30 // of member functions.
31 [[gnu::aligned(16)]]
32 void
33 t::baz(void) {
34 // CHECK-NOEXTRAALIGN: @_ZN1t3bazEv({{.*}}) #0 align 16 {
35 // CHECK-EXTRAALIGN: @_ZN1t3bazEv({{.*}}) #0 align 16 {
36 // CHECK-MSVC: @"?baz@t@@QEAAXXZ"({{.*}}) #0 align 16 {
39 void
40 t::bar(void) {
41 // CHECK-NOEXTRAALIGN: @_ZN1t3barEv({{.*}}) #0 {
42 // CHECK-EXTRAALIGN: @_ZN1t3barEv({{.*}}) #0 align 2 {
43 // CHECK-MSVC: @"?bar@t@@QEAAXXZ"({{.*}}) #0 align 2 {
46 void
47 t::foo(void) {
48 // CHECK-NOEXTRAALIGN: @_ZN1t3fooEv({{.*}}) unnamed_addr #0 {
49 // CHECK-EXTRAALIGN: @_ZN1t3fooEv({{.*}}) unnamed_addr #0 align 2 {
50 // CHECK-MSVC: @"?foo@t@@UEAAXXZ"({{.*}}) unnamed_addr #0 align 2 {