[PATCH] D59219: [PR41007][OpenCL] Allow printf and toolchain reserved variadic functions in C++

Anastasia Stulova via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 14 09:54:06 PDT 2019


Anastasia marked an inline comment as done.
Anastasia added inline comments.


================
Comment at: cfe/trunk/test/SemaOpenCL/extensions.cl:31
 // RUN: %clang_cc1 %s -triple amdgcn-unknown-unknown -verify -pedantic -fsyntax-only -cl-std=CL2.0 -finclude-default-header
-// RUN: %clang_cc1 %s -triple spir-unknown-unknown -verify -pedantic -fsyntax-only -cl-std=c++
+// RUN: %clang_cc1 %s -triple spir-unknown-unknown -verify -pedantic -fsyntax-only -cl-std=c++ -finclude-default-header
 
----------------
bader wrote:
> Shoudn't we move this test to test/SemaOpenCLCXX?
> Does `-finclude-default-header` include opencl-c.h? I think it's an overkill to test that OpenCL C++ allows printf. Ideally we should minimize number of times we parsing 11500+ lines header in LIT tests.
> Shoudn't we move this test to test/SemaOpenCLCXX?

Right now test/SemaOpenCLCXX and other corresponding folders contain only functionality specific to C++.

In test/SemaOpenCL we will keep tests that are OpenCL C compatible even though we are parsing some of them in C++ mode too. We could create a common folder but I don't see much value in this. Let me know if you have other thoughts.



> Does -finclude-default-header include opencl-c.h? I think it's an overkill to test that OpenCL C++ allows printf. Ideally we should minimize number of times we parsing 11500+ lines header in LIT tests.


Yes, I perfectly agree. I would like to make sure that the header is parsed successfully in C++ mode. So it is not just for `printf`. There are a few other places where we parse the header, I can move this into them if you prefer. May be test/Driver/include-default-header.cl would make more sense to show the intent?


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59219/new/

https://reviews.llvm.org/D59219





More information about the llvm-commits mailing list