This is an archive of the discontinued LLVM Phabricator instance.

[OpenCL] Tests C++ for OpenCL version macros
ClosedPublic

Authored by Topotuna on Sep 7 2021, 8:19 AM.

Details

Summary

Version macro definitions are tested for C++ for OpenCL when
explicit version is provided on command line via -cl-std flag.

Diff Detail

Event Timeline

Topotuna created this revision.Sep 7 2021, 8:19 AM
Topotuna requested review of this revision.Sep 7 2021, 8:19 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 7 2021, 8:19 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
Anastasia added inline comments.Sep 9 2021, 3:41 AM
clang/test/Preprocessor/predefined-macros.c
138

I think we should add one extra line with -cl-std=clc++ because this is probably the only way we can test that it now maps to version 1.0.

Topotuna updated this revision to Diff 371544.Sep 9 2021, 3:56 AM
Topotuna retitled this revision from [OpenCL] Tests C++ for OpenCL 2021 version macros to [OpenCL] Tests C++ for OpenCL version macros.
Topotuna edited the summary of this revision. (Show Details)

Test case added for command line flag -cl-std=clc++

Topotuna marked an inline comment as done.Sep 9 2021, 3:56 AM
Anastasia added inline comments.Sep 9 2021, 5:41 AM
clang/test/Preprocessor/predefined-macros.c
139

let's just reuse --check-prefix=CHECK-CLCPP10 to avoid duplication. This will always need to map to some other version so it is unlikely we will ever need separate check lines for it.

Topotuna updated this revision to Diff 371831.Sep 10 2021, 2:04 AM

Reuses --check-prefix=CHECK-CLCPP10 for default C++ for OpenCL command line version

Topotuna marked an inline comment as done.Sep 10 2021, 2:04 AM
Anastasia accepted this revision.Sep 10 2021, 6:46 AM

LGTM! Thanks

This revision is now accepted and ready to land.Sep 10 2021, 6:46 AM
This revision was automatically updated to reflect the committed changes.