Files
clang-p2996/clang/test/AST/alignas_maybe_odr_cleanup.cpp
Nancy Wang f46c41febb [SystemZ][z/OS] fix lit test related to alignment
This patch is to fix lit test case failure relate to alignment, on z/OS, maximum alignment value for 64 bit mode is 16 and also fixed clang/test/Layout/itanium-union-bitfield.cpp, attribute ((aligned(4))) is needed for bit-field member in Union for z/OS because single bit-field has one byte alignment, this will make sure size and alignment will be correct value on z/OS.

Differential Revision: https://reviews.llvm.org/D98793
2021-03-23 13:15:19 -04:00

24 lines
891 B
C++

// Test without serialization:
// RUN: %clang_cc1 -fsyntax-only %s -ast-dump | FileCheck %s
//
// Test with serialization:
// RUN: %clang_cc1 -emit-pch -o %t %s
// RUN: %clang_cc1 -x c++ -include-pch %t -ast-dump-all /dev/null \
// RUN: | sed -e "s/ <undeserialized declarations>//" -e "s/ imported//" \
// RUN: | FileCheck %s
struct FOO {
static const int vec_align_bytes = 16;
void foo() {
double a alignas(vec_align_bytes);
;
}
};
// CHECK: | `-AlignedAttr {{.*}} <col:14> alignas
// CHECK-NEXT: | `-ConstantExpr {{.*}} <col:22> 'int'
// CHECK-NEXT: | |-value: Int 16
// CHECK-NEXT: | `-ImplicitCastExpr {{.*}} <col:22> 'int' <LValueToRValue>
// CHECK-NEXT: | `-DeclRefExpr {{.*}} <col:22> 'const int' lvalue Var {{.*}} 'vec_align_bytes' 'const int' non_odr_use_constant
// CHECK-NEXT: `-NullStmt {{.*}} <line:14:5>