declare_no_pointers.pass.cpp 687 B

1234567891011121314151617181920212223242526
  1. //===----------------------------------------------------------------------===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. // <memory>
  9. // void declare_no_pointers(char* p, size_t n);
  10. // void undeclare_no_pointers(char* p, size_t n);
  11. #include <memory>
  12. #include "test_macros.h"
  13. int main(int, char**)
  14. {
  15. char* p = new char[10];
  16. std::declare_no_pointers(p, 10);
  17. std::undeclare_no_pointers(p, 10);
  18. delete [] p;
  19. return 0;
  20. }