From e7c7a1982632270ae655c7ec8e490ca2c44193a0 Mon Sep 17 00:00:00 2001 From: Anatoliy Tomilov Date: Thu, 12 Nov 2020 11:42:52 -0800 Subject: [PATCH] [Frontend] Treat .cuh files as CUDA source files to synchronize with tools/clang-format/git-clang-format tra: Keeping them in sync does have a minor benefit of not raising a question why the two maps are different. Differential Revision: https://reviews.llvm.org/D91034 --- clang/lib/Frontend/FrontendOptions.cpp | 2 +- clang/test/Parser/cuda-check-input-kind-assoc.cuh | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 clang/test/Parser/cuda-check-input-kind-assoc.cuh diff --git a/clang/lib/Frontend/FrontendOptions.cpp b/clang/lib/Frontend/FrontendOptions.cpp index 9f080db733f1..4ea13cf0784f 100644 --- a/clang/lib/Frontend/FrontendOptions.cpp +++ b/clang/lib/Frontend/FrontendOptions.cpp @@ -29,7 +29,7 @@ InputKind FrontendOptions::getInputKindForExtension(StringRef Extension) { .Case("cppm", Language::CXX) .Case("iim", InputKind(Language::CXX).getPreprocessed()) .Case("cl", Language::OpenCL) - .Case("cu", Language::CUDA) + .Cases("cu", "cuh", Language::CUDA) .Case("hip", Language::HIP) .Cases("ll", "bc", Language::LLVM_IR) .Default(Language::Unknown); diff --git a/clang/test/Parser/cuda-check-input-kind-assoc.cuh b/clang/test/Parser/cuda-check-input-kind-assoc.cuh new file mode 100644 index 000000000000..3c65453833fa --- /dev/null +++ b/clang/test/Parser/cuda-check-input-kind-assoc.cuh @@ -0,0 +1,5 @@ +// RUN: %clang_cc1 -fsyntax-only -Werror %s + +// Check input kind association for cuh extension. + +__attribute__((host, device)) void hd_fn() {}