diff options
| author | kcbanner <kcbanner@gmail.com> | 2023-07-13 01:14:31 -0400 |
|---|---|---|
| committer | kcbanner <kcbanner@gmail.com> | 2023-07-20 22:58:16 -0400 |
| commit | ec96095efd8671ae280df15eaf73f63bf029fbfa (patch) | |
| tree | 06308ef842ad3f6984f673d607fabebcbed28a7b /test/standalone/stack_iterator/shared_lib.c | |
| parent | 7d8b4234774200ff071103399613ed444280a8d0 (diff) | |
| download | zig-ec96095efd8671ae280df15eaf73f63bf029fbfa.tar.gz zig-ec96095efd8671ae280df15eaf73f63bf029fbfa.zip | |
compilation: pass omit_frame_pointer through to builtin.zig
Renamed dwarf_unwinding -> stack_iterator to better reflect that it's not just DWARF unwinding.
Added a test for unwinding with a frame pointer.
Diffstat (limited to 'test/standalone/stack_iterator/shared_lib.c')
| -rw-r--r-- | test/standalone/stack_iterator/shared_lib.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/standalone/stack_iterator/shared_lib.c b/test/standalone/stack_iterator/shared_lib.c new file mode 100644 index 0000000000..c3170f2dc0 --- /dev/null +++ b/test/standalone/stack_iterator/shared_lib.c @@ -0,0 +1,22 @@ +#include <stdint.h>
+
+#ifndef LIB_API
+#define LIB_API
+#endif
+
+__attribute__((noinline)) void frame1(
+ void** expected,
+ void** unwound,
+ void (*frame2)(void** expected, void** unwound)) {
+ expected[3] = __builtin_extract_return_addr(__builtin_return_address(0));
+ frame2(expected, unwound);
+}
+
+LIB_API void frame0(
+ void** expected,
+ void** unwound,
+ void (*frame2)(void** expected, void** unwound)) {
+ expected[4] = __builtin_extract_return_addr(__builtin_return_address(0));
+ frame1(expected, unwound, frame2);
+}
+
|
