Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(389)

Unified Diff: test/CodeGen/le32-vaarg.c

Issue 183973037: Cherry-pick Clang upstream r199830 - Handle va_arg on struct types for the le32 target (PNaCl and E… (Closed) Base URL: http://git.chromium.org/native_client/pnacl-clang.git@master
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/CodeGen/CGExprAgg.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/CodeGen/le32-vaarg.c
diff --git a/test/CodeGen/le32-vaarg.c b/test/CodeGen/le32-vaarg.c
new file mode 100644
index 0000000000000000000000000000000000000000..51bbb0296846dab388bff7fed9edf70ba7470a48
--- /dev/null
+++ b/test/CodeGen/le32-vaarg.c
@@ -0,0 +1,28 @@
+// RUN: %clang_cc1 -triple le32-unknown-nacl -emit-llvm -o - %s | FileCheck %s
+#include <stdarg.h>
+
+int get_int(va_list *args) {
+ return va_arg(*args, int);
+}
+// CHECK: define i32 @get_int
+// CHECK: [[RESULT:%[a-z_0-9]+]] = va_arg {{.*}}, i32{{$}}
+// CHECK: ret i32 [[RESULT]]
+
+struct Foo {
+ int x;
+};
+
+struct Foo dest;
+
+void get_struct(va_list *args) {
+ dest = va_arg(*args, struct Foo);
+}
+// CHECK: define void @get_struct
+// CHECK: [[RESULT:%[a-z_0-9]+]] = va_arg {{.*}}, %struct.Foo{{$}}
+// CHECK: store %struct.Foo [[RESULT]], %struct.Foo* @dest
+
+void skip_struct(va_list *args) {
+ va_arg(*args, struct Foo);
+}
+// CHECK: define void @skip_struct
+// CHECK: va_arg {{.*}}, %struct.Foo{{$}}
« no previous file with comments | « lib/CodeGen/CGExprAgg.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698