[PATCH] D20444: [OpenCL] Include opencl-c.h by default as a clang module
Anastasia Stulova via cfe-commits
cfe-commits at lists.llvm.org
Wed Jun 8 09:44:32 PDT 2016
Anastasia added inline comments.
================
Comment at: test/Headers/opencl-c-header.cl:50
@@ +49,3 @@
+// RUN: %clang_cc1 -cc1 -triple spir-unknown-unknown -emit-llvm -o - -finclude-default-header -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fdisable-module-hash %s | FileCheck %s
+// RUN: diff %t/1_0.pcm %t/opencl_c.pcm
+// RUN: rm %t/opencl_c.pcm
----------------
yaxunl wrote:
> Anastasia wrote:
> > I see, but is diffing accurate here? Because if the file is regenerated but with exactly the same content it won't be caught...
> It cannot detect if the file was re-written with the same content.
>
> There is one way we can do that:
> get the modified time of the file
> sleep 1 second
> get the modified time of the file again and compare
>
> but it will slow down the test by 1 second. do we really want to do that?
Not desirable to increase the testing time. I was wondering if we could amend the attribute of the file let's say run chmod on it? I guess if it's regenerated it would get default attributes again?
Otherwise, I would rather skip testing uniqueness, if we can't do it properly. We rely on the existing modules functionality anyways which is already being tested elsewhere.
================
Comment at: test/Headers/opencl-c-header.cl:70
@@ +69,3 @@
+// RUN: %clang_cc1 -cc1 -triple amdgcn--amdhsa -emit-llvm -o - -cl-std=CL2.0 -finclude-default-header -fmodules -fimplicit-module-maps -fmodules-cache-path=%t %s | FileCheck --check-prefix=CHECK20 %s
+// RUN: %clang_cc1 -cc1 -triple spir-unknown-unknown -emit-llvm -o - -finclude-default-header -fmodules -fimplicit-module-maps -fmodules-cache-path=%t %s | FileCheck %s
+// RUN: %clang_cc1 -cc1 -triple spir-unknown-unknown -emit-llvm -o - -cl-std=CL2.0 -finclude-default-header -fmodules -fimplicit-module-maps -fmodules-cache-path=%t %s | FileCheck --check-prefix=CHECK20 %s
----------------
yaxunl wrote:
> Anastasia wrote:
> > So in this line it will be regenerated because the line above used different triple?
> No. It should use the cached module.
Ok, but it doesn't seem like there is something different being tested to line 67.
http://reviews.llvm.org/D20444
More information about the cfe-commits
mailing list