Apply suggestion from HJ Lu to avoid misaligned stack in test
authorReid Kleckner <rnk@google.com>
Mon, 4 Apr 2016 18:27:32 +0000 (18:27 +0000)
committerReid Kleckner <rnk@google.com>
Mon, 4 Apr 2016 18:27:32 +0000 (18:27 +0000)
Fixes PR27191

llvm-svn: 265322

compiler-rt/test/asan/TestCases/Linux/clone_test.cc

index e9c1f16..f6eb261 100644 (file)
@@ -22,7 +22,7 @@ int Child(void *arg) {
 
 int main(int argc, char **argv) {
   const int kStackSize = 1 << 20;
-  char child_stack[kStackSize + 1];
+  char __attribute__((aligned(16))) child_stack[kStackSize + 1];
   char *sp = child_stack + kStackSize;  // Stack grows down.
   printf("Parent: %p\n", sp);
   pid_t clone_pid = clone(Child, sp, CLONE_FILES | CLONE_VM, NULL);