diff options
Diffstat (limited to 'test/CodeGenCXX/x86_64-arguments.cpp')
-rw-r--r-- | test/CodeGenCXX/x86_64-arguments.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/CodeGenCXX/x86_64-arguments.cpp b/test/CodeGenCXX/x86_64-arguments.cpp index 2172e0810d752..815ef6111a9ae 100644 --- a/test/CodeGenCXX/x86_64-arguments.cpp +++ b/test/CodeGenCXX/x86_64-arguments.cpp @@ -32,6 +32,21 @@ typedef int (s4::*s4_mfp)(); s4_mdp f4_0(s4_mdp a) { return a; } s4_mfp f4_1(s4_mfp a) { return a; } +// A struct with <= one eightbyte before a member data pointer should still +// be allowed in registers. +// CHECK-LABEL: define void @{{.*}}f_struct_with_mdp{{.*}}(i8* %a.coerce0, i64 %a.coerce1) +struct struct_with_mdp { char *a; s4_mdp b; }; +void f_struct_with_mdp(struct_with_mdp a) { (void)a; } + +// A struct with anything before a member function will be too big and +// goes in memory. +// CHECK-LABEL: define void @{{.*}}f_struct_with_mfp_0{{.*}}(%struct{{.*}} byval align 8 %a) +struct struct_with_mfp_0 { char a; s4_mfp b; }; +void f_struct_with_mfp_0(struct_with_mfp_0 a) { (void)a; } + +// CHECK-LABEL: define void @{{.*}}f_struct_with_mfp_1{{.*}}(%struct{{.*}} byval align 8 %a) +struct struct_with_mfp_1 { void *a; s4_mfp b; }; +void f_struct_with_mfp_1(struct_with_mfp_1 a) { (void)a; } namespace PR7523 { struct StringRef { |