[llvm] [NFC][llvm][object][GOFF] cleanup GOFFObjectTests (PR #212286)
David Tenty via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 28 07:34:39 PDT 2026
================
@@ -11,26 +11,91 @@
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Testing/Support/Error.h"
#include "gtest/gtest.h"
+#include <vector>
using namespace llvm;
using namespace llvm::object;
using namespace llvm::GOFF;
namespace {
-char GOFFData[GOFF::RecordLength * 3] = {0x00};
+size_t newRecord(std::vector<char> &Data) {
+ size_t Pos = Data.size();
+ Data.resize(Pos + GOFF::RecordLength);
+ return Pos;
+}
+
+void addEndRecord(std::vector<char> &GOFFData, uint8_t RecordCount = 0) {
+ size_t Pos = newRecord(GOFFData);
+ GOFFData[Pos] = (char)0x03;
+ GOFFData[Pos + 1] = (char)0x40;
----------------
daltenty wrote:
These are essentially just the magic that tells you it's the record of this kind and wether it's continued across multiple records or not. I'll add a comment to that effect.
https://github.com/llvm/llvm-project/pull/212286
More information about the llvm-commits
mailing list