Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
ttreyer committed May 23, 2024
1 parent 6e4010f commit 099b9f5
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions tests/field_analyser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include "mocks.h"
#include "gtest/gtest.h"

#include <llvm/Config/llvm-config.h>

namespace bpftrace {
namespace test {
namespace field_analyser {
Expand Down Expand Up @@ -596,8 +598,15 @@ TEST_F(field_analyser_dwarf, parse_inheritance_multi)
std::string uprobe = "uprobe:" + std::string(cxx_bin_);
test(bpftrace, uprobe + ":cpp:func_3 { $x = args.m->abc; }", 0);

ASSERT_TRUE(bpftrace.structs.Has("struct Multi"));
auto cls = bpftrace.structs.Lookup("struct Multi").lock();
std::shared_ptr<Struct> cls;
printf("LLVM_VERSION_MAJOR: %d\n", LLVM_VERSION_MAJOR);
if (LLVM_VERSION_MAJOR <= 12) {
ASSERT_TRUE(bpftrace.structs.Has("Multi"));
cls = bpftrace.structs.Lookup("Multi").lock();
} else {
ASSERT_TRUE(bpftrace.structs.Has("struct Multi"));
cls = bpftrace.structs.Lookup("struct Multi").lock();
}

ASSERT_TRUE(cls->HasFields());
ASSERT_EQ(cls->fields.size(), 6);
Expand Down

0 comments on commit 099b9f5

Please sign in to comment.