[NSan] Make Tests work with Internal Shell

There was one test that was using a subshell. This is not supported by
lit's internal shell. Rewrite the test to use the readfile substitution.

Reviewers: alexander-shaposhnikov, fmayer

Reviewed By: alexander-shaposhnikov, fmayer

Pull Request: https://github.com/llvm/llvm-project/pull/165142
This commit is contained in:
Aiden Grossman 2025-10-30 12:29:09 -07:00 committed by GitHub
parent 8067b5cff7
commit d2c5e49015
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2,7 +2,8 @@
/// Test that a module constructor can not map memory over the NSan heap
/// (without MAP_FIXED, of course).
// RUN: %clangxx_nsan -O0 %s -o %t_1
// RUN: %clangxx_nsan -O0 -DHEAP_ADDRESS=$(%run %t_1) %s -o %t_2 && %run %t_2
// RUN: %run %t_1 > %t.heap_address
// RUN: %clangxx_nsan -O0 -DHEAP_ADDRESS=%{readfile:%t.heap_address} %s -o %t_2 && %run %t_2
#include <assert.h>
#include <stdio.h>