brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · 6757180 Raw
50 lines · cpp
1// RUN: %clang_cc1 -x c++ -emit-llvm -triple=mips-unknown-linux-gnu < %s | FileCheck --check-prefix=O32 %s2// RUN: %clang_cc1 -x c++ -emit-llvm -triple=mips64-unknown-linux-gnu -target-abi n32 < %s | FileCheck --check-prefix=N32 %s3// RUN: %clang_cc1 -x c++ -emit-llvm -triple=mips64-unknown-linux-gnu -target-abi n64 < %s | FileCheck --check-prefix=N64 %s4 5// Test that the size_t is correct for the ABI. It's not sufficient to be the6// correct size, it must be the same type for correct name mangling.7 8long *alloc_long() {9  long *rv = new long; // size_t is implicit in the new operator10  return rv;11}12// O32-LABEL: define{{.*}} ptr @_Z10alloc_longv()13// O32: call noalias noundef nonnull ptr @_Znwj(i32 noundef signext 4)14 15// N32-LABEL: define{{.*}} ptr @_Z10alloc_longv()16// N32: call noalias noundef nonnull ptr @_Znwj(i32 noundef signext 4)17 18// N64-LABEL: define{{.*}} ptr @_Z10alloc_longv()19// N64: call noalias noundef nonnull ptr @_Znwm(i64 noundef zeroext 8)20 21long *alloc_long_array() {22  long *rv = new long[2];23  return rv;24}25 26// O32-LABEL: define{{.*}} ptr @_Z16alloc_long_arrayv()27// O32: call noalias noundef nonnull ptr @_Znaj(i32 noundef signext 8)28 29// N32-LABEL: define{{.*}} ptr @_Z16alloc_long_arrayv()30// N32: call noalias noundef nonnull ptr @_Znaj(i32 noundef signext 8)31 32// N64-LABEL: define{{.*}} ptr @_Z16alloc_long_arrayv()33// N64: call noalias noundef nonnull ptr @_Znam(i64 noundef zeroext 16)34 35#include <stddef.h>36 37void size_t_arg(size_t a) {38}39 40// O32-LABEL: _Z10size_t_argj41// N32-LABEL: _Z10size_t_argj42// N64-LABEL: _Z10size_t_argm43 44void ptrdiff_t_arg(ptrdiff_t a) {45}46 47// O32-LABEL: _Z13ptrdiff_t_argi48// N32-LABEL: _Z13ptrdiff_t_argi49// N64-LABEL: _Z13ptrdiff_t_argl50