Home | History | Annotate | Download | only in CodeGenCXX
      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
      4 
      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.
      7 
      8 long *alloc_long() {
      9   long *rv = new long; // size_t is implicit in the new operator
     10   return rv;
     11 }
     12 // O32-LABEL: define i32* @_Z10alloc_longv()
     13 // O32: call i8* @_Znwj(i32 signext 4)
     14 
     15 // N32-LABEL: define i32* @_Z10alloc_longv()
     16 // N32: call i8* @_Znwj(i32 signext 4)
     17 
     18 // N64-LABEL: define i64* @_Z10alloc_longv()
     19 // N64: call i8* @_Znwm(i64 zeroext 8)
     20 
     21 long *alloc_long_array() {
     22   long *rv = new long[2];
     23   return rv;
     24 }
     25 
     26 // O32-LABEL: define i32* @_Z16alloc_long_arrayv()
     27 // O32: call i8* @_Znaj(i32 signext 8)
     28 
     29 // N32-LABEL: define i32* @_Z16alloc_long_arrayv()
     30 // N32: call i8* @_Znaj(i32 signext 8)
     31 
     32 // N64-LABEL: define i64* @_Z16alloc_long_arrayv()
     33 // N64: call i8* @_Znam(i64 zeroext 16)
     34 
     35 #include <stddef.h>
     36 
     37 void size_t_arg(size_t a) {
     38 }
     39 
     40 // O32-LABEL: _Z10size_t_argj
     41 // N32-LABEL: _Z10size_t_argj
     42 // N64-LABEL: _Z10size_t_argm
     43 
     44 void ptrdiff_t_arg(ptrdiff_t a) {
     45 }
     46 
     47 // O32-LABEL: _Z13ptrdiff_t_argi
     48 // N32-LABEL: _Z13ptrdiff_t_argi
     49 // N64-LABEL: _Z13ptrdiff_t_argl
     50