blob: 7ebbedc9989ee9995eda40dff596aa6715e0c5ed [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -o - %s | FileCheck %s
Anders Carlsson0a8f8472009-09-16 15:53:40 +00002
Daniel Dunbarce9f4232009-11-22 23:01:23 +00003// CHECK: [[i64_i64_ty:%.*]] = type { i64, i64 }
4// CHECK: [[i64_double_ty:%.*]] = type { i64, double }
Anders Carlsson0a8f8472009-09-16 15:53:40 +00005
Daniel Dunbarce9f4232009-11-22 23:01:23 +00006// Basic base class test.
7struct f0_s0 { unsigned a; };
8struct f0_s1 : public f0_s0 { void *b; };
9// CHECK: define void @_Z2f05f0_s1([[i64_i64_ty]])
10void f0(f0_s1 a0) { }
11
12// Check with two eight-bytes in base class.
13struct f1_s0 { unsigned a; unsigned b; float c; };
14struct f1_s1 : public f1_s0 { float d;};
15// CHECK: define void @_Z2f15f1_s1([[i64_double_ty]])
16void f1(f1_s1 a0) { }
17
18// Check with two eight-bytes in base class and merge.
19struct f2_s0 { unsigned a; unsigned b; float c; };
20struct f2_s1 : public f2_s0 { char d;};
21// CHECK: define void @_Z2f25f2_s1([[i64_i64_ty]])
22void f2(f2_s1 a0) { }
23
Daniel Dunbar4971ff82009-12-22 01:19:25 +000024// PR5831
25struct s3_0 {};
26struct s3_1 { struct s3_0 a; long b; };
27void f3(struct s3_1 x) {}