[compiler-rt] 57d34cb - Revert "[sanitizer] Fix compilation of the test"

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 1 22:25:35 PDT 2021


Author: Vitaly Buka
Date: 2021-11-01T22:25:26-07:00
New Revision: 57d34cb223127bc1e42c6f29f1fe6ae7190091f8

URL: https://github.com/llvm/llvm-project/commit/57d34cb223127bc1e42c6f29f1fe6ae7190091f8
DIFF: https://github.com/llvm/llvm-project/commit/57d34cb223127bc1e42c6f29f1fe6ae7190091f8.diff

LOG: Revert "[sanitizer] Fix compilation of the test"
Revert "[sanitizer] Fix PosixSpawnImpl which fails exitcode test"

This reverts commit 8cabd8f0d26c3cff03faec9b1cea974f08618d6d and part of 9213202abd275c26c51cc46e2a34c678051bd179.

It is not enough for Android.

Added: 
    

Modified: 
    compiler-rt/test/sanitizer_common/TestCases/Posix/posix_spawn.c

Removed: 
    


################################################################################
diff  --git a/compiler-rt/test/sanitizer_common/TestCases/Posix/posix_spawn.c b/compiler-rt/test/sanitizer_common/TestCases/Posix/posix_spawn.c
index 6bc0a00b2871..6e12abf3ed0d 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Posix/posix_spawn.c
+++ b/compiler-rt/test/sanitizer_common/TestCases/Posix/posix_spawn.c
@@ -1,4 +1,7 @@
 // RUN: %clang %s -o %t && %run %t 2>&1 | FileCheck %s
+//
+// Older versions of Android do not have certain posix_spawn* functions.
+// UNSUPPORTED: android
 
 #include <assert.h>
 #include <spawn.h>
@@ -13,8 +16,15 @@ int main(int argc, char **argv) {
     return 0;
   }
 
-  posix_spawnattr_t attr = {0};
-  posix_spawn_file_actions_t file_actions = {0};
+  int s;
+
+  posix_spawnattr_t attr;
+  s = posix_spawnattr_init(&attr);
+  assert(!s);
+
+  posix_spawn_file_actions_t file_actions;
+  s = posix_spawn_file_actions_init(&file_actions);
+  assert(!s);
 
   char *const args[] = {
       argv[0], "2", "3", "4", "2", "3", "4", "2", "3", "4",
@@ -26,7 +36,7 @@ int main(int argc, char **argv) {
   };
 
   pid_t pid;
-  int s = posix_spawn(&pid, argv[0], &file_actions, &attr, args, env);
+  s = posix_spawn(&pid, argv[0], &file_actions, &attr, args, env);
   assert(!s);
 
   waitpid(pid, &s, WUNTRACED | WCONTINUED);


        


More information about the llvm-commits mailing list