aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/Object/OffloadingTest.cpp
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2023-09-01 09:19:25 -0700
committerFangrui Song <i@maskray.me>2023-09-01 09:19:25 -0700
commitf93c271d4cc11b865b87da1402e1cb33449fe4bf (patch)
tree882fed26ab9fd70700aea6abc6cd5f2326b4bf02 /llvm/unittests/Object/OffloadingTest.cpp
parent0a97720d0197e60a10c93f8af7d24e5f6d6a9807 (diff)
downloadllvm-f93c271d4cc11b865b87da1402e1cb33449fe4bf.zip
llvm-f93c271d4cc11b865b87da1402e1cb33449fe4bf.tar.gz
llvm-f93c271d4cc11b865b87da1402e1cb33449fe4bf.tar.bz2
[Object] Change OffloadBinary::write to return SmallString<0>
SmallString<0> is more flexible and avoids an unneeded copy in ObjectYAML/OffloadEmitter.cpp. Reviewed By: jhuber6 Differential Revision: https://reviews.llvm.org/D159335
Diffstat (limited to 'llvm/unittests/Object/OffloadingTest.cpp')
-rw-r--r--llvm/unittests/Object/OffloadingTest.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/unittests/Object/OffloadingTest.cpp b/llvm/unittests/Object/OffloadingTest.cpp
index 77d8b14..18c9efa 100644
--- a/llvm/unittests/Object/OffloadingTest.cpp
+++ b/llvm/unittests/Object/OffloadingTest.cpp
@@ -43,8 +43,8 @@ TEST(OffloadingTest, checkOffloadingBinary) {
Data.StringData = StringData;
Data.Image = std::move(ImageData);
- auto BinaryBuffer = OffloadBinary::write(Data);
-
+ auto BinaryBuffer =
+ MemoryBuffer::getMemBufferCopy(OffloadBinary::write(Data));
auto BinaryOrErr = OffloadBinary::create(*BinaryBuffer);
if (!BinaryOrErr)
FAIL();