Skip to content

[scudo][gwp_asan] Clean up Fuchsia zxtest framework integration #90015

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

frobtech
Copy link
Contributor

@frobtech frobtech commented Apr 25, 2024

This brings the scudo and gwp_asan code in line with how the
llvm-libc code selects using zxtest vs gtest on Fuchsia.

This brings the scudo and gwp_asan code in line with how the
llvm-libc code selects using zxtest vs gtest on Fuchsia.
@llvmbot
Copy link
Member

llvmbot commented Apr 25, 2024

@llvm/pr-subscribers-compiler-rt-sanitizer

Author: Roland McGrath (frobtech)

Changes

When the characteristics of a procedure depend on a procedure that
hasn't yet been defined, the compiler currently emits an unconditional
error message. This includes the case of a procedure whose
characteristics depend, perhaps indirectly, on itself. However, in the
case where the characteristics of a procedure are needed to resolve a
generic, we should not emit an error for a hitherto undefined procedure
-- either the call will resolve to another specific procedure, in which
case the error is spurious, or it won't, and then an error will issue
anyway.

Fixes #88677.


Full diff: https://github.com/llvm/llvm-project/pull/90015.diff

2 Files Affected:

  • (modified) compiler-rt/lib/gwp_asan/tests/harness.h (+1-1)
  • (modified) compiler-rt/lib/scudo/standalone/tests/scudo_unit_test.h (+1-1)
diff --git a/compiler-rt/lib/gwp_asan/tests/harness.h b/compiler-rt/lib/gwp_asan/tests/harness.h
index ae39a443bd0a09..205a0250329e4f 100644
--- a/compiler-rt/lib/gwp_asan/tests/harness.h
+++ b/compiler-rt/lib/gwp_asan/tests/harness.h
@@ -11,7 +11,7 @@
 
 #include <stdarg.h>
 
-#if defined(__Fuchsia__)
+#ifdef LIBC_COPT_TEST_USE_ZXTEST
 #define ZXTEST_USE_STREAMABLE_MACROS
 #include <zxtest/zxtest.h>
 namespace testing = zxtest;
diff --git a/compiler-rt/lib/scudo/standalone/tests/scudo_unit_test.h b/compiler-rt/lib/scudo/standalone/tests/scudo_unit_test.h
index 4283416435ba0c..1a911d2d8dff44 100644
--- a/compiler-rt/lib/scudo/standalone/tests/scudo_unit_test.h
+++ b/compiler-rt/lib/scudo/standalone/tests/scudo_unit_test.h
@@ -8,7 +8,7 @@
 
 #include "platform.h"
 
-#if SCUDO_FUCHSIA
+#ifdef LIBC_COPT_TEST_USE_ZXTEST
 #include <zxtest/zxtest.h>
 using Test = ::zxtest::Test;
 #else

@frobtech frobtech changed the title [flang] Make proc characterization error conditional for generics (#89429) [scudo][gwp_asan] Clean up Fuchsia zxtest framework integration Apr 25, 2024
@frobtech frobtech requested review from fabio-d and Caslyn April 25, 2024 04:40
Copy link
Contributor

@fabio-d fabio-d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with comments

@@ -8,7 +8,7 @@

#include "platform.h"

#if SCUDO_FUCHSIA
#ifdef LIBC_COPT_TEST_USE_ZXTEST
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At line 48 too?

@@ -11,7 +11,7 @@

#include <stdarg.h>

#if defined(__Fuchsia__)
#ifdef LIBC_COPT_TEST_USE_ZXTEST
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is removing the only occurrence of "Fuchsia" in this file, I'm wondering if we could leave some breadcrumb comment that ties zxtest back to Fuchsia like you did in libc/test/UnitTest/Test.h, for the benefit of those who don't know what zxtest is

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants