x86_64-arguments.cpp revision a9e05156438dc3f0ef1067ffce80037d9333e022
1// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -o - %s | FileCheck %s
2
3// Basic base class test.
4struct f0_s0 { unsigned a; };
5struct f0_s1 : public f0_s0 { void *b; };
6// CHECK: define void @_Z2f05f0_s1(i64 %a0.coerce0, i8* %a0.coerce1)
7void f0(f0_s1 a0) { }
8
9// Check with two eight-bytes in base class.
10struct f1_s0 { unsigned a; unsigned b; float c; };
11struct f1_s1 : public f1_s0 { float d;};
12// CHECK: define void @_Z2f15f1_s1(i64 %a0.coerce0, double %a0.coerce1)
13void f1(f1_s1 a0) { }
14
15// Check with two eight-bytes in base class and merge.
16struct f2_s0 { unsigned a; unsigned b; float c; };
17struct f2_s1 : public f2_s0 { char d;};
18// CHECK: define void @_Z2f25f2_s1(i64 %a0.coerce0, i64 %a0.coerce1)
19void f2(f2_s1 a0) { }
20
21// PR5831
22struct s3_0 {};
23struct s3_1 { struct s3_0 a; long b; };
24void f3(struct s3_1 x) {}
25
26// CHECK: define i64 @_Z4f4_0M2s4i(i64 %a.coerce)
27// CHECK: define {{.*}} @_Z4f4_1M2s4FivE(i64 %a.coerce0, i64 %a.coerce1)
28struct s4 {};
29typedef int s4::* s4_mdp;
30typedef int (s4::*s4_mfp)();
31s4_mdp f4_0(s4_mdp a) { return a; }
32s4_mfp f4_1(s4_mfp a) { return a; }
33