aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGenCXX/call-arg-zero-temp.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2009-10-20 23:29:04 +0000
committerFariborz Jahanian <fjahanian@apple.com>2009-10-20 23:29:04 +0000
commit48620bafe4ba879f96c2d17caefeb79f3fae2eea (patch)
treefa5e799ee50437137a9aea09756a85ce808e4f93 /test/CodeGenCXX/call-arg-zero-temp.cpp
parent705348544cdf9db2b88ebfa60966b62a5be1f3f1 (diff)
Code-gen for CXXZeroInitValueExpr AST passed
as argument to a function call. Removes a FIXME. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84694 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/call-arg-zero-temp.cpp')
-rw-r--r--test/CodeGenCXX/call-arg-zero-temp.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/CodeGenCXX/call-arg-zero-temp.cpp b/test/CodeGenCXX/call-arg-zero-temp.cpp
new file mode 100644
index 0000000000..2c44f69d97
--- /dev/null
+++ b/test/CodeGenCXX/call-arg-zero-temp.cpp
@@ -0,0 +1,23 @@
+// RUN: clang-cc -triple x86_64-apple-darwin -S %s -o %t-64.s &&
+// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s &&
+// RUN: clang-cc -triple i386-apple-darwin -S %s -o %t-32.s &&
+// RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s &&
+// RUN: true
+
+
+extern "C" int printf(...);
+
+struct obj{ int a; float b; double d; };
+
+void foo(obj o) {
+ printf("%d %f %f\n", o.a, o.b, o.d);
+}
+
+int main() {
+ obj o = obj();
+ foo(obj());
+}
+
+// CHECK-LP64: call __Z3foo3obj
+
+// CHECK-LP32: call __Z3foo3obj