diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -605,7 +605,7 @@ HelpText<"OpenCL only. Allow use of less precise no signed zeros computations in the generated binary.">, MarshallingInfoFlag<"LangOpts->CLNoSignedZero">; def cl_std_EQ : Joined<["-"], "cl-std=">, Group, Flags<[CC1Option]>, - HelpText<"OpenCL language standard to compile for.">, Values<"cl,CL,cl1.1,CL1.1,cl1.2,CL1.2,cl2.0,CL2.0,cl3.0,CL3.0,clc++,CLC++">; + HelpText<"OpenCL language standard to compile for.">, Values<"cl,CL,cl1.0,CL1.0,cl1.1,CL1.1,cl1.2,CL1.2,cl2.0,CL2.0,cl3.0,CL3.0,clc++,CLC++">; def cl_denorms_are_zero : Flag<["-"], "cl-denorms-are-zero">, Group, HelpText<"OpenCL only. Allow denormals to be flushed to zero.">; def cl_fp32_correctly_rounded_divide_sqrt : Flag<["-"], "cl-fp32-correctly-rounded-divide-sqrt">, Group, Flags<[CC1Option]>, diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -2596,6 +2596,7 @@ LangStandard::Kind OpenCLLangStd = llvm::StringSwitch(A->getValue()) .Cases("cl", "CL", LangStandard::lang_opencl10) + .Cases("cl1.0", "CL1.0", LangStandard::lang_opencl10) .Cases("cl1.1", "CL1.1", LangStandard::lang_opencl11) .Cases("cl1.2", "CL1.2", LangStandard::lang_opencl12) .Cases("cl2.0", "CL2.0", LangStandard::lang_opencl20) diff --git a/clang/test/Driver/autocomplete.c b/clang/test/Driver/autocomplete.c --- a/clang/test/Driver/autocomplete.c +++ b/clang/test/Driver/autocomplete.c @@ -37,6 +37,8 @@ // CLSTDALL: cl // CLSTDALL-NEXT: CL +// CLSTDALL-NEXT: cl1.0 +// CLSTDALL-NEXT: CL1.0 // CLSTDALL-NEXT: cl1.1 // CLSTDALL-NEXT: CL1.1 // CLSTDALL-NEXT: cl1.2 diff --git a/clang/test/Driver/opencl.cl b/clang/test/Driver/opencl.cl --- a/clang/test/Driver/opencl.cl +++ b/clang/test/Driver/opencl.cl @@ -1,4 +1,5 @@ // RUN: %clang -S -### -cl-std=CL %s 2>&1 | FileCheck --check-prefix=CHECK-CL %s +// RUN: %clang -S -### -cl-std=CL1.0 %s 2>&1 | FileCheck --check-prefix=CHECK-CL10 %s // RUN: %clang -S -### -cl-std=CL1.1 %s 2>&1 | FileCheck --check-prefix=CHECK-CL11 %s // RUN: %clang -S -### -cl-std=CL1.2 %s 2>&1 | FileCheck --check-prefix=CHECK-CL12 %s // RUN: %clang -S -### -cl-std=CL2.0 %s 2>&1 | FileCheck --check-prefix=CHECK-CL20 %s @@ -20,6 +21,7 @@ // RUN: not %clang -cl-std=invalid -DOPENCL %s 2>&1 | FileCheck --check-prefix=CHECK-INVALID %s // CHECK-CL: "-cc1" {{.*}} "-cl-std=CL" +// CHECK-CL10: "-cc1" {{.*}} "-cl-std=CL1.0" // CHECK-CL11: "-cc1" {{.*}} "-cl-std=CL1.1" // CHECK-CL12: "-cc1" {{.*}} "-cl-std=CL1.2" // CHECK-CL20: "-cc1" {{.*}} "-cl-std=CL2.0" diff --git a/clang/test/Frontend/stdlang.c b/clang/test/Frontend/stdlang.c --- a/clang/test/Frontend/stdlang.c +++ b/clang/test/Frontend/stdlang.c @@ -1,6 +1,7 @@ // RUN: %clang_cc1 -x cuda -std=c++11 -DCUDA %s // RUN: %clang_cc1 -x cl -DOPENCL %s // RUN: %clang_cc1 -x cl -cl-std=cl -DOPENCL %s +// RUN: %clang_cc1 -x cl -cl-std=cl1.0 -DOPENCL %s // RUN: %clang_cc1 -x cl -cl-std=cl1.1 -DOPENCL %s // RUN: %clang_cc1 -x cl -cl-std=cl1.2 -DOPENCL %s // RUN: %clang_cc1 -x cl -cl-std=cl2.0 -DOPENCL %s diff --git a/clang/test/Preprocessor/predefined-macros.c b/clang/test/Preprocessor/predefined-macros.c --- a/clang/test/Preprocessor/predefined-macros.c +++ b/clang/test/Preprocessor/predefined-macros.c @@ -123,6 +123,8 @@ // RUN: %clang_cc1 %s -E -dM -o - -x cl \ // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-CL10 +// RUN: %clang_cc1 %s -E -dM -o - -x cl -cl-std=CL1.0 \ +// RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-CL10 // RUN: %clang_cc1 %s -E -dM -o - -x cl -cl-std=CL1.1 \ // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-CL11 // RUN: %clang_cc1 %s -E -dM -o - -x cl -cl-std=CL1.2 \