This is an archive of the discontinued LLVM Phabricator instance.

[CUDA] Add tests for compiling CUDA files with -E.
ClosedPublic

Authored by jlebar on Jan 11 2016, 1:19 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

jlebar updated this revision to Diff 44541.Jan 11 2016, 1:19 PM
jlebar retitled this revision from to [CUDA] Add tests for compiling CUDA files with -E..
jlebar updated this object.
jlebar added a reviewer: tra.
jlebar added subscribers: jhen, cfe-commits.
tra added inline comments.Jan 13 2016, 10:15 AM
test/Driver/cuda-preprocess.cu
13–16 ↗(On Diff #44541)

Given it's a driver test you probably just want to check the list of commands generated by driver (-###)

Checking preprocessing results would probably belong to test/Preprocessor.

17 ↗(On Diff #44541)

This would succeed if we fail to preprocess as it would catch 'clang_unittest_no_arch' in the #ifndef above.

I'd add some macro which will get preprocessed away:

#ifndef __CUDA_ARCH__
#define PREPROCESSED_AWAY
clang_unittest_no_arch __ PREPROCESSED_AWAY
...

It may be an overkill, though. Up to you.

jlebar updated this revision to Diff 44823.Jan 13 2016, 6:10 PM

Address tra's review comments.

jlebar marked 2 inline comments as done.Jan 13 2016, 6:10 PM
jlebar added inline comments.
test/Driver/cuda-preprocess.cu
13–16 ↗(On Diff #44541)

Cool, moved to Preprocessor/.

17 ↗(On Diff #44541)

sgtm, done.

jlebar marked 2 inline comments as done.Jan 13 2016, 6:11 PM

Thank you for the review, Artem.

tra accepted this revision.Jan 14 2016, 11:29 AM
tra edited edge metadata.
This revision is now accepted and ready to land.Jan 14 2016, 11:29 AM
This revision was automatically updated to reflect the committed changes.