[PATCH] D155176: [BTF] Fix BTFParserTest.cpp for unaligned access after D149058

Eduard Zingerman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 13 06:39:55 PDT 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rG490e8e22b1e3: [BTF] Fix BTFParserTest.cpp for unaligned access after D149058 (authored by eddyz87).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155176/new/

https://reviews.llvm.org/D155176

Files:
  llvm/unittests/DebugInfo/BTF/BTFParserTest.cpp


Index: llvm/unittests/DebugInfo/BTF/BTFParserTest.cpp
===================================================================
--- llvm/unittests/DebugInfo/BTF/BTFParserTest.cpp
+++ llvm/unittests/DebugInfo/BTF/BTFParserTest.cpp
@@ -45,11 +45,11 @@
 // modified before a call to `makeObj()` to test parser with invalid
 // input, etc.
 
+struct MockData1 {
 // Use "pragma pack" to model .BTF & .BTF.ext sections content using
 // 'struct' objects. This pragma is supported by CLANG, GCC & MSVC,
 // which matters for LLVM CI.
 #pragma pack(push, 1)
-struct MockData1 {
   struct B {
     BTF::Header Header = {};
     // no types
@@ -100,6 +100,7 @@
       Header.LineInfoLen = sizeof(Lines);
     }
   } Ext;
+#pragma pack(pop)
 
   int BTFSectionLen = sizeof(BTF);
   int ExtSectionLen = sizeof(Ext);
@@ -148,7 +149,6 @@
     return *Obj.get();
   }
 };
-#pragma pack(pop)
 
 TEST(BTFParserTest, simpleCorrectInput) {
   BTFParser BTF;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D155176.540000.patch
Type: text/x-patch
Size: 934 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230713/9ec2377a/attachment.bin>


More information about the llvm-commits mailing list