1 | // RUN: %clang_cc1 -triple mips64el-unknown-linux -O3 -S -target-abi n64 -o - -emit-llvm %s | FileCheck %s |
2 | |
3 | class B0 { |
4 | double d; |
5 | }; |
6 | |
7 | class D0 : public B0 { |
8 | float f; |
9 | }; |
10 | |
11 | class B1 { |
12 | }; |
13 | |
14 | class D1 : public B1 { |
15 | double d; |
16 | float f; |
17 | }; |
18 | |
19 | class D2 : public B0 { |
20 | double d2; |
21 | }; |
22 | |
23 | extern D0 gd0; |
24 | extern D1 gd1; |
25 | extern D2 gd2; |
26 | |
27 | // CHECK: define inreg { i64, i64 } @_Z4foo1v() |
28 | D0 foo1(void) { |
29 | return gd0; |
30 | } |
31 | |
32 | // CHECK: define inreg { double, float } @_Z4foo2v() |
33 | D1 foo2(void) { |
34 | return gd1; |
35 | } |
36 | |
37 | // CHECK-LABEL: define void @_Z4foo32D2(i64 inreg %a0.coerce0, double inreg %a0.coerce1) |
38 | void foo3(D2 a0) { |
39 | gd2 = a0; |
40 | } |
41 | |
42 | // CHECK-LABEL: define void @_Z4foo42D0(i64 inreg %a0.coerce0, i64 inreg %a0.coerce1) |
43 | void foo4(D0 a0) { |
44 | gd0 = a0; |
45 | } |
46 | |
47 | |