| 1 |
// REQUIRES: !system-windows |
| 2 |
// |
| 3 |
// RUN: rm -rf %t |
| 4 |
// RUN: split-file %s %t |
| 5 |
// RUN: cd %t |
| 6 |
// |
| 7 |
// RUN: %clang_cc1 -std=c++20 -O3 %t/a.cppm -emit-module-interface -o %t/a.pcm |
| 8 |
// RUN: %clang_cc1 -std=c++20 -O3 %t/test.cc -fmodule-file=a=%t/a.pcm \ |
| 9 |
// RUN: -emit-llvm -o - | FileCheck %t/test.cc |
| 10 |
|
| 11 |
//--- memmove.h |
| 12 |
typedef long unsigned int size_t; |
| 13 |
extern "C" void *memmove (void *__dest, const void *__src, size_t __n) |
| 14 |
throw () __attribute__ ((__nonnull__ (1, 2))); |
| 15 |
extern "C" __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) void * |
| 16 |
memmove (void *__dest, const void *__src, size_t __len) throw () |
| 17 |
{ |
| 18 |
return __builtin_memmove(__dest, __src, __len); |
| 19 |
} |
| 20 |
|
| 21 |
//--- a.cppm |
| 22 |
module; |
| 23 |
#include "memmove.h" |
| 24 |
export module a; |
| 25 |
export using ::memmove; |
| 26 |
|
| 27 |
//--- test.cc |
| 28 |
import a; |
| 29 |
|
| 30 |
void test() { |
| 31 |
int a, b; |
| 32 |
unsigned c = 0; |
| 33 |
memmove(&a, &b, c); |
| 34 |
} |
| 35 |
|
| 36 |
// CHECK-NOT: memmove |