[PATCH] D19944: [MSan] Add a test for vararg with lots of non-vararg arguments.

Marcin Koƛcielnicki via llvm-commits llvm-commits at lists.llvm.org
Wed May 4 16:08:27 PDT 2016


koriakin created this revision.
koriakin added reviewers: eugenis, aizatsky.
koriakin added a subscriber: llvm-commits.
koriakin set the repository for this revision to rL LLVM.
koriakin added a project: Sanitizers.
Herald added a subscriber: aemerson.

This is a testcase for http://llvm.org/PR27646, hitting the bug on x86_64,
aarch64, mips.

To be commited once the bug is fixed (the test currently FAILs on all three targets).

Repository:
  rL LLVM

http://reviews.llvm.org/D19944

Files:
  lib/msan/tests/msan_test.cc

Index: lib/msan/tests/msan_test.cc
===================================================================
--- lib/msan/tests/msan_test.cc
+++ lib/msan/tests/msan_test.cc
@@ -2462,6 +2462,20 @@
   vaargsfn_many(1, 2, *x, 3, 4, 5, 6, 7, 8, 9, *y);
 }
 
+static void vaargsfn_manyfix(int g1, int g2, int g3, int g4, int g5, int g6, int g7, int g8, int g9, ...) {
+  va_list vl;
+  va_start(vl, g9);
+  EXPECT_NOT_POISONED(va_arg(vl, int));
+  EXPECT_POISONED(va_arg(vl, int));
+  va_end(vl);
+}
+
+TEST(MemorySanitizer, VAArgManyFixTest) {
+  int* x = GetPoisoned<int>();
+  int* y = GetPoisoned<int>();
+  vaargsfn_manyfix(1, *x, 3, 4, 5, 6, 7, 8, 9, 10, *y);
+}
+
 static void vaargsfn_pass2(va_list vl) {
   EXPECT_NOT_POISONED(va_arg(vl, int));
   EXPECT_NOT_POISONED(va_arg(vl, int));


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D19944.56217.patch
Type: text/x-patch
Size: 784 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160504/921ffea5/attachment.bin>


More information about the llvm-commits mailing list