brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · d4397f3 Raw
36 lines · cpp
1// REQUIRES: powerpc-registered-target2// RUN: %clang_cc1 -triple powerpc-unknown-aix \3// RUN:     -emit-llvm -o - -x c++ %s | \4// RUN:   FileCheck %s --check-prefixes=AIX,AIX325// RUN: %clang_cc1 -triple powerpc64-unknown-aix \6// RUN:     -emit-llvm -o - %s -x c++| \7// RUN:   FileCheck %s --check-prefixes=AIX,AIX648 9struct B {10  double d;11  ~B() {}12};13 14// AIX32: %call = call noalias noundef nonnull ptr @_Znam(i32 noundef 8)15// AIX64: %call = call noalias noundef nonnull ptr @_Znam(i64 noundef 8)16B *allocBp() { return new B[0]; }17 18// AIX-LABEL: delete.notnull:19// AIX32: %0 = getelementptr inbounds i8, ptr %call, i32 -820// AIX32: [[PTR:%.+]] = getelementptr inbounds i8, ptr %0, i32 421// AIX64: [[PTR:%.+]] = getelementptr inbounds i8, ptr %call, i64 -822// AIX:   %{{.+}} = load i{{[0-9]+}}, ptr [[PTR]]23void bar() { delete[] allocBp(); }24 25typedef struct D {26  double d;27  int i;28 29  ~D(){};30} D;31 32// AIX: define void @_Z3foo1D(ptr dead_on_unwind noalias writable sret(%struct.D) align 4 %agg.result, ptr noundef %x)33// AIX32  call void @llvm.memcpy.p0.p0.i32(ptr align 4 %agg.result, ptr align 4 %x, i32 16, i1 false)34// AIX64: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.result, ptr align 4 %x, i64 16, i1 false)35D foo(D x) { return x; }36