| 1 | // RUN: %clang_cc1 -triple mipsel-unknown-linux -O3 -S -o - -emit-llvm %s | FileCheck %s -check-prefix=O32 |
| 2 | // RUN: %clang_cc1 -triple mips64el-unknown-linux -O3 -S -target-abi n64 -o - -emit-llvm %s | FileCheck %s -check-prefix=N64 |
| 3 | |
| 4 | // check that |
| 5 | // 1. vector arguments are passed in integer registers |
| 6 | // 2. argument alignment is no larger than 8-byte for O32 and 16-byte for N64. |
| 7 | |
| 8 | typedef float v4sf __attribute__ ((__vector_size__ (16))); |
| 9 | typedef int v4i32 __attribute__ ((__vector_size__ (16))); |
| 10 | |
| 11 | // O32: define void @test_v4sf(i32 inreg %a1.coerce0, i32 inreg %a1.coerce1, i32 inreg %a1.coerce2, i32 inreg %a1.coerce3, i32 signext %a2, i32, i32 inreg %a3.coerce0, i32 inreg %a3.coerce1, i32 inreg %a3.coerce2, i32 inreg %a3.coerce3) local_unnamed_addr [[NUW:#[0-9]+]] |
| 12 | // O32: declare i32 @test_v4sf_2(i32 inreg, i32 inreg, i32 inreg, i32 inreg, i32 signext, i32, i32 inreg, i32 inreg, i32 inreg, i32 inreg) |
| 13 | // N64: define void @test_v4sf(i64 inreg %a1.coerce0, i64 inreg %a1.coerce1, i32 signext %a2, i64, i64 inreg %a3.coerce0, i64 inreg %a3.coerce1) local_unnamed_addr [[NUW:#[0-9]+]] |
| 14 | // N64: declare signext i32 @test_v4sf_2(i64 inreg, i64 inreg, i32 signext, i64, i64 inreg, i64 inreg) |
| 15 | extern test_v4sf_2(v4sf, int, v4sf); |
| 16 | void test_v4sf(v4sf a1, int a2, v4sf a3) { |
| 17 | test_v4sf_2(a3, a2, a1); |
| 18 | } |
| 19 | |
| 20 | // O32: define void @test_v4i32(i32 inreg %a1.coerce0, i32 inreg %a1.coerce1, i32 inreg %a1.coerce2, i32 inreg %a1.coerce3, i32 signext %a2, i32, i32 inreg %a3.coerce0, i32 inreg %a3.coerce1, i32 inreg %a3.coerce2, i32 inreg %a3.coerce3) local_unnamed_addr [[NUW]] |
| 21 | // O32: declare i32 @test_v4i32_2(i32 inreg, i32 inreg, i32 inreg, i32 inreg, i32 signext, i32, i32 inreg, i32 inreg, i32 inreg, i32 inreg) |
| 22 | // N64: define void @test_v4i32(i64 inreg %a1.coerce0, i64 inreg %a1.coerce1, i32 signext %a2, i64, i64 inreg %a3.coerce0, i64 inreg %a3.coerce1) local_unnamed_addr [[NUW]] |
| 23 | // N64: declare signext i32 @test_v4i32_2(i64 inreg, i64 inreg, i32 signext, i64, i64 inreg, i64 inreg) |
| 24 | extern test_v4i32_2(v4i32, int, v4i32); |
| 25 | void test_v4i32(v4i32 a1, int a2, v4i32 a3) { |
| 26 | test_v4i32_2(a3, a2, a1); |
| 27 | } |
| 28 | |
| 29 | // O32: attributes [[NUW]] = { nounwind{{.*}} } |
| 30 | |
| 31 | // N64: attributes [[NUW]] = { nounwind{{.*}} } |
| 32 | |