// RUN: %clang_cc1 -no-opaque-pointers -triple x86_64-unknown-unknown %s \
// RUN: -faligned-allocation -fsized-deallocation -emit-llvm -o - \
// RUN: | FileCheck %s
typedef __SIZE_TYPE__ size_t;
// Declare an 'operator new' template to tickle a bug in __builtin_operator_new.
void *operator new;
// Ensure that this declaration doesn't cause operator new to lose its
// 'noalias' attribute.
void *operator new;
std::nothrow_t nothrow;
// Declare the reserved placement operators.
void *operator new throw;
void operator delete throw;
void *operator new throw;
void operator delete[] throw;
// Declare the replaceable global allocation operators.
void *operator new throw;
void *operator new throw;
void operator delete throw;
void operator delete[] throw;
// Declare some other placement operators.
void *operator new throw;
void *operator new throw;
// CHECK-LABEL: define{{.*}} void @test_basic(
extern "C" void
// CHECK: declare noundef nonnull i8* @_Znwm(i64 noundef) [[ATTR_NOBUILTIN:#[^ ]*]]
// CHECK: declare void @_ZdlPv(i8* noundef) [[ATTR_NOBUILTIN_NOUNWIND:#[^ ]*]]
// CHECK-LABEL: define{{.*}} void @test_aligned_alloc(
extern "C" void
// CHECK: declare noundef nonnull i8* @_ZnwmSt11align_val_t(i64 noundef, i64 noundef) [[ATTR_NOBUILTIN:#[^ ]*]]
// CHECK: declare void @_ZdlPvSt11align_val_t(i8* noundef, i64 noundef) [[ATTR_NOBUILTIN_NOUNWIND:#[^ ]*]]
// CHECK-LABEL: define{{.*}} void @test_sized_delete(
extern "C" void
// CHECK: declare void @_ZdlPvm(i8* noundef, i64 noundef) [[ATTR_NOBUILTIN_UNWIND:#[^ ]*]]
// CHECK-DAG: attributes [[ATTR_NOBUILTIN]] = {{[{].*}} nobuiltin {{.*[}]}}
// CHECK-DAG: attributes [[ATTR_NOBUILTIN_NOUNWIND]] = {{[{].*}} nobuiltin nounwind {{.*[}]}}
// CHECK-DAG: attributes [[ATTR_BUILTIN_NEW]] = {{[{].*}} builtin {{.*[}]}}
// CHECK-DAG: attributes [[ATTR_BUILTIN_DELETE]] = {{[{].*}} builtin {{.*[}]}}