summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/x86_32-arguments.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-05-11 21:15:36 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-05-11 21:15:36 +0000
commit12ebb47a07a82596841118af9d7ecb4b1b57b0b2 (patch)
treece56f337fd3e7de285b570833fa958e901bccfc9 /clang/test/CodeGenCXX/x86_32-arguments.cpp
parent44e865f4879e8b3e984349b292cead781e79b1d2 (diff)
downloadbcm5719-llvm-12ebb47a07a82596841118af9d7ecb4b1b57b0b2.tar.gz
bcm5719-llvm-12ebb47a07a82596841118af9d7ecb4b1b57b0b2.zip
IRgen/i386/C++: Fix isSingleElementStruct computation for C++ record decls.
- Fixes PR7098. llvm-svn: 103514
Diffstat (limited to 'clang/test/CodeGenCXX/x86_32-arguments.cpp')
-rw-r--r--clang/test/CodeGenCXX/x86_32-arguments.cpp34
1 files changed, 33 insertions, 1 deletions
diff --git a/clang/test/CodeGenCXX/x86_32-arguments.cpp b/clang/test/CodeGenCXX/x86_32-arguments.cpp
index 141d3af44af..3af2746345d 100644
--- a/clang/test/CodeGenCXX/x86_32-arguments.cpp
+++ b/clang/test/CodeGenCXX/x86_32-arguments.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple i386-unknown-unknown -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple i386-apple-darwin9 -emit-llvm -o - %s | FileCheck %s
// Non-trivial dtors, should both be passed indirectly.
struct S {
@@ -13,6 +13,7 @@ void f(S) { }
// Non-trivial dtors, should both be passed indirectly.
class C {
+public:
~C();
double c;
};
@@ -51,3 +52,34 @@ struct BasicAliasAnalysis : public ModulePass, public AliasAnalysis {
void BasicAliasAnalysis::getModRefInfo(CallSite CS) {
}
+
+// Check various single element struct type conditions.
+//
+// PR7098.
+
+// CHECK: define i64 @_Z2f0v()
+struct s0_0 { int x; };
+struct s0_1 : s0_0 { int* y; };
+s0_1 f0() { return s0_1(); }
+
+// CHECK: define i32 @_Z2f1v()
+struct s1_0 { int x; };
+struct s1_1 : s1_0 { };
+s1_1 f1() { return s1_1(); }
+
+// CHECK: define double @_Z2f2v()
+struct s2_0 { double x; };
+struct s2_1 : s2_0 { };
+s2_1 f2() { return s2_1(); }
+
+// CHECK: define double @_Z2f3v()
+struct s3_0 { };
+struct s3_1 { double x; };
+struct s3_2 : s3_0, s3_1 { };
+s3_2 f3() { return s3_2(); }
+
+// CHECK: define i64 @_Z2f4v()
+struct s4_0 { float x; };
+struct s4_1 { float x; };
+struct s4_2 : s4_0, s4_1 { };
+s4_2 f4() { return s4_2(); }
OpenPOWER on IntegriCloud