[libunwind] libunwind: Remove OS requirements from tests to make them run on more OSes (PR #167642)
Alexander Richardson via cfe-commits
cfe-commits at lists.llvm.org
Tue Nov 18 13:06:11 PST 2025
================
----------------
arichardson wrote:
This attribute is the reason the test fails on macos, since the syntax is different there. It was added in https://github.com/llvm/llvm-project/pull/85097/files. Apparently I even reviewed it but I don't recall doing so.
I think there are two options here:
1) Add an XFAIL for macos
2) Something like the following, which should work for GCC and Clang, but may not be portable to all architectures.
```suggestion
#include <stdint.h>
uintptr_t start_main;
uintptr_t end_main;
extern void foo(void);
int main(int, char **) {
start_main = (uintptr_t)&&func_start;
end_main = (uintptr_t)&&func_end;
func_start:
foo();
return -2;
func_end:;
}
```
https://github.com/llvm/llvm-project/pull/167642
More information about the cfe-commits
mailing list