Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGenCXX / mips-size_t-ptrdiff_t.cpp
blob6757180684bf54bf96e179d0c07b51b9b6b43616
1 // RUN: %clang_cc1 -x c++ -emit-llvm -triple=mips-unknown-linux-gnu < %s | FileCheck --check-prefix=O32 %s
2 // RUN: %clang_cc1 -x c++ -emit-llvm -triple=mips64-unknown-linux-gnu -target-abi n32 < %s | FileCheck --check-prefix=N32 %s
3 // RUN: %clang_cc1 -x c++ -emit-llvm -triple=mips64-unknown-linux-gnu -target-abi n64 < %s | FileCheck --check-prefix=N64 %s
5 // Test that the size_t is correct for the ABI. It's not sufficient to be the
6 // correct size, it must be the same type for correct name mangling.
8 long *alloc_long() {
9 long *rv = new long; // size_t is implicit in the new operator
10 return rv;
12 // O32-LABEL: define{{.*}} ptr @_Z10alloc_longv()
13 // O32: call noalias noundef nonnull ptr @_Znwj(i32 noundef signext 4)
15 // N32-LABEL: define{{.*}} ptr @_Z10alloc_longv()
16 // N32: call noalias noundef nonnull ptr @_Znwj(i32 noundef signext 4)
18 // N64-LABEL: define{{.*}} ptr @_Z10alloc_longv()
19 // N64: call noalias noundef nonnull ptr @_Znwm(i64 noundef zeroext 8)
21 long *alloc_long_array() {
22 long *rv = new long[2];
23 return rv;
26 // O32-LABEL: define{{.*}} ptr @_Z16alloc_long_arrayv()
27 // O32: call noalias noundef nonnull ptr @_Znaj(i32 noundef signext 8)
29 // N32-LABEL: define{{.*}} ptr @_Z16alloc_long_arrayv()
30 // N32: call noalias noundef nonnull ptr @_Znaj(i32 noundef signext 8)
32 // N64-LABEL: define{{.*}} ptr @_Z16alloc_long_arrayv()
33 // N64: call noalias noundef nonnull ptr @_Znam(i64 noundef zeroext 16)
35 #include <stddef.h>
37 void size_t_arg(size_t a) {
40 // O32-LABEL: _Z10size_t_argj
41 // N32-LABEL: _Z10size_t_argj
42 // N64-LABEL: _Z10size_t_argm
44 void ptrdiff_t_arg(ptrdiff_t a) {
47 // O32-LABEL: _Z13ptrdiff_t_argi
48 // N32-LABEL: _Z13ptrdiff_t_argi
49 // N64-LABEL: _Z13ptrdiff_t_argl