Commit 55033066 authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook GitHub Bot

a test for memcpy-use

Summary: Proves the internal build rule replaces `memcpy`.

Reviewed By: LoganEvans

Differential Revision: D29665797

fbshipit-source-id: 7f3a8550853261de94cedf9545b6445d11297b2b
parent 367f28b7
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <folly/FollyMemcpy.h>
#include <cstring>
#include <folly/lang/Keep.h>
#include <folly/portability/GTest.h>
extern "C" FOLLY_KEEP void check_c_memcpy(void* d, void* s, size_t n) {
memcpy(d, s, n);
}
extern "C" FOLLY_KEEP void check_std_memcpy(void* d, void* s, size_t n) {
std::memcpy(d, s, n);
}
extern "C" FOLLY_KEEP void check_folly_memcpy(void* d, void* s, size_t n) {
__folly_memcpy(d, s, n);
}
TEST(MemcpyUseTest, empty) {
// this empty test existing forces the keeps above, the native code of which
// may be inspected to prove that the internal build rules actually replace
// what would otherwise be calls to memcpy with calls to __folly_memcpy
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment