Print NULL as "(null)" in diagnostic message

Summary:
Passing a null pointer to the printf family for a %s format specifier leads to undefined behaviour. The tests currently expect (null). Explicitly test for a null pointer and provide the expected string.

Authored By: andusy

Reviewers: hubert.reinterpretcast, xingxue, jasonliu, daltenty, cebowleratibm

Reviewed By: hubert.reinterpretcast

Subscribers: arphaman, jsji, cfe-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D63786

llvm-svn: 364462
1 file changed
tree: a08f17e82e1a0e9334f44ef8f59ad1f1e9f26d10
  1. .arcconfig
  2. .clang-format
  3. .clang-tidy
  4. .github/
  5. .gitignore
  6. README.md
  7. clang-tools-extra/
  8. clang/
  9. compiler-rt/
  10. debuginfo-tests/
  11. libclc/
  12. libcxx/
  13. libcxxabi/
  14. libunwind/
  15. lld/
  16. lldb/
  17. llgo/
  18. llvm/
  19. openmp/
  20. parallel-libs/
  21. polly/
  22. pstl/
README.md

The LLVM Compiler Infrastructure

This directory and its subdirectories contain source code for LLVM, a toolkit for the construction of highly optimized compilers, optimizers, and runtime environments.