u_debug_stack_test: Fix MSVC compiling by using ATTRIBUTE_NOINLINE

Fixes: d0d14f3f ("util: Add unit test for stack backtrace caputure")

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6303>
(cherry picked from commit 58af31186a)
This commit is contained in:
Jesse Natalie 2020-08-13 10:33:29 -07:00 committed by Dylan Baker
parent 66fc0ad7d6
commit ed256fd804
2 changed files with 5 additions and 4 deletions

View file

@ -1597,7 +1597,7 @@
"description": "u_debug_stack_test: Fix MSVC compiling by using ATTRIBUTE_NOINLINE",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"master_sha": null,
"because_sha": "d0d14f3f6481e015b4413fa0487164b76fe45296"
},

View file

@ -24,9 +24,10 @@
#include <stdio.h>
#include <gtest/gtest.h>
#include "util/macros.h"
#include "util/u_debug_stack.h"
static void __attribute__((noinline))
static void ATTRIBUTE_NOINLINE
func_a(void)
{
struct debug_stack_frame backtrace[16];
@ -36,7 +37,7 @@ func_a(void)
debug_backtrace_dump(backtrace, 16);
}
static void __attribute__((noinline))
static void ATTRIBUTE_NOINLINE
func_b(void)
{
struct debug_stack_frame backtrace[16];
@ -48,7 +49,7 @@ func_b(void)
debug_backtrace_dump(backtrace, 16);
}
static void __attribute__((noinline))
static void ATTRIBUTE_NOINLINE
func_c(struct debug_stack_frame *frames)
{
debug_backtrace_capture(frames, 0, 16);