diff --git a/clang/include/clang/Basic/LangOptions.def b/clang/include/clang/Basic/LangOptions.def index bca6056d2ed82..aa8f6cbf547fa 100644 --- a/clang/include/clang/Basic/LangOptions.def +++ b/clang/include/clang/Basic/LangOptions.def @@ -259,7 +259,7 @@ LANGOPT(DeclareSPIRVBuiltins, 1, 0, "Declare SPIR-V builtin functions") LANGOPT(SYCLExplicitSIMD , 1, 0, "SYCL compilation with explicit SIMD extension") LANGOPT(EnableDAEInSpirKernels , 1, 0, "Enable Dead Argument Elimination in SPIR kernels") LANGOPT( - SYCLValueFitInMaxInt, 1, 0, + SYCLValueFitInMaxInt, 1, 1, "SYCL compiler assumes value fits within MAX_INT for member function of " "get/operator[], get_id/operator[] and get_global_id/get_global_linear_id " "in SYCL class id, iterm and nd_iterm") diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td index 752d41575a76f..98dcee80a65d2 100644 --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -2493,7 +2493,7 @@ def fsycl_instrument_device_code : Flag<["-"], "fsycl-instrument-device-code">, HelpText<"Add ITT instrumentation intrinsics calls">, MarshallingInfoFlag>; defm sycl_id_queries_fit_in_int: BoolFOption<"sycl-id-queries-fit-in-int", - LangOpts<"SYCLValueFitInMaxInt">, DefaultFalse, + LangOpts<"SYCLValueFitInMaxInt">, DefaultTrue, PosFlag, NegFlag, BothFlags<[CC1Option, CoreOption], " that SYCL ID queries fit within MAX_INT.">>; def fsycl_use_bitcode : Flag<["-"], "fsycl-use-bitcode">, diff --git a/clang/test/Preprocessor/sycl-macro.cpp b/clang/test/Preprocessor/sycl-macro.cpp index 2f92bb9e26c74..6c836079f332d 100644 --- a/clang/test/Preprocessor/sycl-macro.cpp +++ b/clang/test/Preprocessor/sycl-macro.cpp @@ -1,4 +1,5 @@ // RUN: %clang_cc1 %s -E -dM | FileCheck %s +// RUN: %clang_cc1 %s -fsycl-is-device -E -dM | FileCheck --check-prefix=CHECK-SYCL-ID %s // RUN: %clang_cc1 %s -fsycl-id-queries-fit-in-int -fsycl-is-host -sycl-std=2017 -E -dM | FileCheck --check-prefix=CHECK-SYCL-STD %s // RUN: %clang_cc1 %s -fsycl-id-queries-fit-in-int -fsycl-is-device -sycl-std=2017 -E -dM | FileCheck --check-prefix=CHECK-SYCL-STD %s // RUN: %clang_cc1 %s -fsycl-id-queries-fit-in-int -fsycl-is-device -sycl-std=2020 -E -dM | FileCheck --check-prefix=CHECK-SYCL-STD-2020 %s @@ -26,3 +27,4 @@ // CHECK-MSVC: #define __SYCL_ID_QUERIES_FIT_IN_INT__ 1 // CHECK-NO-SYCL_FIT_IN_INT-NOT:#define __SYCL_ID_QUERIES_FIT_IN_INT__ 1 +// CHECK-SYCL-ID:#define __SYCL_ID_QUERIES_FIT_IN_INT__ 1