Update Sanitizer tests for Android R.

Summary:
Sanitizer tests don't entirely pass on an R device. Fix up all the
incompatibilities with the new system.

Reviewers: eugenis, pcc

Reviewed By: eugenis

Subscribers: #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

Differential Revision: https://reviews.llvm.org/D75303
This commit is contained in:
Mitch Phillips 2020-02-27 14:15:09 -08:00
parent 86565c1309
commit 20f508efc0
3 changed files with 15 additions and 0 deletions

View File

@ -4,6 +4,11 @@
// Test ASan initialization
// This test closes the 0, 1, and 2 file descriptors before an exec() and relies
// on them remaining closed across an execve(). This is not the case on newer
// versions of Android.
// UNSUPPORTED: android
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>

View File

@ -1,6 +1,12 @@
// Test strict_string_checks option in strstr function
// RUN: %clang_asan %s -o %t && %run %t 2>&1
// Newer versions of Android's strstr() uses memchr() internally, which actually
// does trigger a heap-buffer-overflow (as it tries to find the
// null-terminator).
// UNSUPPORTED: android
// RUN: %env_asan_opts=strict_string_checks=false %run %t 2>&1
// RUN: %env_asan_opts=strict_string_checks=true not %run %t 2>&1 | FileCheck %s
#include <assert.h>

View File

@ -1,5 +1,9 @@
// RUN: %clangxx -g %s -o %t && %run %t
// Newer versions of Android have FDSan, and will fail this test as FDSan will
// catch the error instead.
// UNSUPPORTED: android
#include <assert.h>
#include <stdio.h>
#include <unistd.h>