brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · a0fe737 Raw
39 lines · cpp
1// RUN: %clang_cc1 -std=c++98 %s -triple x86_64-linux-gnu -emit-llvm -o - -fexceptions -fcxx-exceptions -pedantic-errors | FileCheck %s2// RUN: %clang_cc1 -std=c++11 %s -triple x86_64-linux-gnu -emit-llvm -o - -fexceptions -fcxx-exceptions -pedantic-errors | FileCheck %s3// RUN: %clang_cc1 -std=c++14 %s -triple x86_64-linux-gnu -emit-llvm -o - -fexceptions -fcxx-exceptions -pedantic-errors | FileCheck %s4// RUN: %clang_cc1 -std=c++17 %s -triple x86_64-linux-gnu -emit-llvm -o - -fexceptions -fcxx-exceptions -pedantic-errors | FileCheck %s5// RUN: %clang_cc1 -std=c++20 %s -triple x86_64-linux-gnu -emit-llvm -o - -fexceptions -fcxx-exceptions -pedantic-errors | FileCheck %s6// RUN: %clang_cc1 -std=c++23 %s -triple x86_64-linux-gnu -emit-llvm -o - -fexceptions -fcxx-exceptions -pedantic-errors | FileCheck %s7// RUN: %clang_cc1 -std=c++2c %s -triple x86_64-linux-gnu -emit-llvm -o - -fexceptions -fcxx-exceptions -pedantic-errors | FileCheck %s8 9// cwg1748: 3.710 11// FIXME: __SIZE_TYPE__ expands to 'long long' on some targets.12__extension__ typedef __SIZE_TYPE__ size_t;13 14void *operator new(size_t, void *);15void *operator new[](size_t, void *);16 17struct X { X(); };18 19// The reserved placement allocation functions get inlined20// even if we can't see their definitions. They do not21// perform a null check.22 23// CHECK-LABEL: define {{.*}} @_Z1fPv(24// CHECK-NOT: call25// CHECK-NOT: icmp{{.*}} null26// CHECK-NOT: br i127// CHECK: call void @_ZN1XC1Ev(28// CHECK: }29X *f(void *p) { return new (p) X; }30 31// CHECK-LABEL: define {{.*}} @_Z1gPv(32// CHECK-NOT: call33// CHECK-NOT: icmp{{.*}} null34// CHECK-NOT: br i135// CHECK: call void @_ZN1XC1Ev(36// CHECK: br i137// CHECK: }38X *g(void *p) { return new (p) X[5]; }39