Revert tests/run-make/mte-ffi changes

Partially reverts commit 40311c4dcf.
This commit is contained in:
Jieyou Xu 2025-06-10 23:46:39 +08:00
parent 2783fc43fd
commit 24a25dbb88
No known key found for this signature in database
GPG key ID: 045B995028EA6AFC
4 changed files with 4 additions and 7 deletions

View file

@ -1,5 +1,3 @@
// FIXME(#141600) the mte-ffi test doesn't fail in aarch64-gnu
#ifndef __BAR_H
#define __BAR_H

View file

@ -3,9 +3,9 @@
#include <stdint.h>
#include "bar.h"
extern void foo(float*);
extern void foo(char*);
void bar(float *ptr) {
void bar(char *ptr) {
if (((uintptr_t)ptr >> 56) != 0x1f) {
fprintf(stderr, "Top byte corrupted on Rust -> C FFI boundary!\n");
exit(1);

View file

@ -5,7 +5,7 @@
extern void foo(unsigned int *);
void bar(unsigned int *ptr) {
void bar(char *ptr) {
if (((uintptr_t)ptr >> 56) != 0x1f) {
fprintf(stderr, "Top byte corrupted on Rust -> C FFI boundary!\n");
exit(1);

View file

@ -1,7 +1,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include "bar.h"
extern void foo(char*);
@ -33,7 +32,7 @@ int main(void)
// Store an arbitrary tag in bits 56-59 of the pointer (where an MTE tag may be),
// and a different value in the ignored top 4 bits.
ptr = (char *)((uintptr_t)ptr | 0x1fl << 56);
ptr = (unsigned int *)((uintptr_t)ptr | 0x1fl << 56);
if (mte_enabled()) {
set_tag(ptr);