Revert "Move internal usages of alignof/__alignof to use _LIBCPP_ALIGNOF. "

This reverts commit 087f065cb0.

The tests were failing on 32 bit builds, and I don't have time
to clean them up right now. I'll recommit tomorrow with fixed tests.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347816 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Fiselier
2018-11-28 22:24:19 +00:00
parent cf99ab780c
commit e3e576ae50
10 changed files with 44 additions and 90 deletions

View File

@@ -1,37 +0,0 @@
// -*- C++ -*-
//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// Test that _LIBCPP_ALIGNOF acts the same as the C++11 keyword `alignof`, and
// not as the GNU extension `__alignof`. The former returns the minimal required
// alignment for a type, whereas the latter returns the preferred alignment.
//
// See llvm.org/PR39713
#include <type_traits>
#include "test_macros.h"
template <class T>
void test() {
static_assert(_LIBCPP_ALIGNOF(T) == std::alignment_of<T>::value, "");
static_assert(_LIBCPP_ALIGNOF(T) == TEST_ALIGNOF(T), "");
#if TEST_STD_VER >= 11
static_assert(_LIBCPP_ALIGNOF(T) == alignof(T), "");
#endif
#ifdef TEST_COMPILER_CLANG
static_assert(_LIBCPP_ALIGNOF(T) == _Alignof(T), "");
#endif
}
int main() {
test<int>();
test<long long>();
test<double>();
test<long double>();
}