summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/CodeGenOpenCL/builtins-r600.cl2
-rw-r--r--clang/test/CodeGenOpenCL/fpmath.cl2
-rw-r--r--clang/test/CodeGenOpenCL/half.cl2
-rw-r--r--clang/test/Lexer/opencl-half-literal.cl2
-rw-r--r--clang/test/Misc/languageOptsOpenCL.cl2
-rw-r--r--clang/test/PCH/opencl-extensions.cl4
-rw-r--r--clang/test/Parser/opencl-astype.cl2
-rw-r--r--clang/test/Parser/opencl-atomics-cl20.cl26
-rw-r--r--clang/test/Parser/opencl-pragma.cl2
-rw-r--r--clang/test/Parser/opencl-storage-class.cl2
-rw-r--r--clang/test/SemaOpenCL/extension-fp64-cl1.1.cl19
-rw-r--r--clang/test/SemaOpenCL/extension-fp64.cl19
-rw-r--r--clang/test/SemaOpenCL/extensions.cl36
-rw-r--r--clang/test/SemaOpenCL/half.cl2
-rw-r--r--clang/test/SemaOpenCL/invalid-kernel-parameters.cl2
-rw-r--r--clang/test/SemaOpenCL/invalid-logical-ops-1.2.cl3
-rw-r--r--clang/test/SemaOpenCL/optional-core-fp64-cl1.2.cl20
-rw-r--r--clang/test/SemaOpenCL/optional-core-fp64-cl2.0.cl20
18 files changed, 103 insertions, 64 deletions
diff --git a/clang/test/CodeGenOpenCL/builtins-r600.cl b/clang/test/CodeGenOpenCL/builtins-r600.cl
index 6369f3d83db..001dc06f597 100644
--- a/clang/test/CodeGenOpenCL/builtins-r600.cl
+++ b/clang/test/CodeGenOpenCL/builtins-r600.cl
@@ -1,5 +1,5 @@
// REQUIRES: amdgpu-registered-target
-// RUN: %clang_cc1 -triple r600-unknown-unknown -target-cpu rv670 -S -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple r600-unknown-unknown -S -emit-llvm -o - %s | FileCheck %s
#pragma OPENCL EXTENSION cl_khr_fp64 : enable
diff --git a/clang/test/CodeGenOpenCL/fpmath.cl b/clang/test/CodeGenOpenCL/fpmath.cl
index 88df3bf166a..ef4da845529 100644
--- a/clang/test/CodeGenOpenCL/fpmath.cl
+++ b/clang/test/CodeGenOpenCL/fpmath.cl
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -emit-llvm -o - -triple spir-unknown-unknown | FileCheck %s
+// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
typedef __attribute__(( ext_vector_type(4) )) float float4;
diff --git a/clang/test/CodeGenOpenCL/half.cl b/clang/test/CodeGenOpenCL/half.cl
index 9acabf0a2a8..bd5ae7f6499 100644
--- a/clang/test/CodeGenOpenCL/half.cl
+++ b/clang/test/CodeGenOpenCL/half.cl
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -emit-llvm -o - -triple spir-unknown-unknown | FileCheck %s
+// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
#pragma OPENCL EXTENSION cl_khr_fp16 : enable
diff --git a/clang/test/Lexer/opencl-half-literal.cl b/clang/test/Lexer/opencl-half-literal.cl
index 42ca5146b1f..2415ee4fd8c 100644
--- a/clang/test/Lexer/opencl-half-literal.cl
+++ b/clang/test/Lexer/opencl-half-literal.cl
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -fsyntax-only -verify -triple spir-unknown-unknown
+// RUN: %clang_cc1 %s -fsyntax-only -verify
#pragma OPENCL EXTENSION cl_khr_fp16 : enable
diff --git a/clang/test/Misc/languageOptsOpenCL.cl b/clang/test/Misc/languageOptsOpenCL.cl
index 9651f01a7dc..82a8f3614f3 100644
--- a/clang/test/Misc/languageOptsOpenCL.cl
+++ b/clang/test/Misc/languageOptsOpenCL.cl
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -x cl %s -verify -triple spir-unknown-unknown
+// RUN: %clang_cc1 -x cl %s -verify
// expected-no-diagnostics
// Test the forced language options for OpenCL are set correctly.
diff --git a/clang/test/PCH/opencl-extensions.cl b/clang/test/PCH/opencl-extensions.cl
index d6d541658a1..a22b007f9d5 100644
--- a/clang/test/PCH/opencl-extensions.cl
+++ b/clang/test/PCH/opencl-extensions.cl
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -emit-pch -o %t %s -triple spir-unknown-unknown
-// RUN: %clang_cc1 -include-pch %t -fsyntax-only %s -triple spir-unknown-unknown
+// RUN: %clang_cc1 -emit-pch -o %t %s
+// RUN: %clang_cc1 -include-pch %t -fsyntax-only %s
#ifndef HEADER
#define HEADER
diff --git a/clang/test/Parser/opencl-astype.cl b/clang/test/Parser/opencl-astype.cl
index 903c42ee8c1..72f98a4ace9 100644
--- a/clang/test/Parser/opencl-astype.cl
+++ b/clang/test/Parser/opencl-astype.cl
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s -triple spir-unknown-unknown
+// RUN: %clang_cc1 -fsyntax-only -verify %s
#pragma OPENCL EXTENSION cl_khr_fp64 : enable
void test_astype() {
diff --git a/clang/test/Parser/opencl-atomics-cl20.cl b/clang/test/Parser/opencl-atomics-cl20.cl
index 20f969645fe..cb2f59721ac 100644
--- a/clang/test/Parser/opencl-atomics-cl20.cl
+++ b/clang/test/Parser/opencl-atomics-cl20.cl
@@ -1,14 +1,11 @@
-// RUN: %clang_cc1 %s -triple spir-unknown-unknown -verify -pedantic -fsyntax-only
-// RUN: %clang_cc1 %s -triple spir-unknown-unknown -verify -fsyntax-only -cl-std=CL2.0 -DCL20
-// RUN: %clang_cc1 %s -triple spir-unknown-unknown -verify -fsyntax-only -cl-std=CL2.0 -DCL20 -DEXT
+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only
+// RUN: %clang_cc1 %s -verify -fsyntax-only -cl-std=CL2.0 -DCL20
+// RUN: %clang_cc1 %s -verify -fsyntax-only -cl-std=CL2.0 -DCL20 -DEXT
#ifdef EXT
#pragma OPENCL EXTENSION cl_khr_int64_base_atomics:enable
#pragma OPENCL EXTENSION cl_khr_int64_extended_atomics:enable
#pragma OPENCL EXTENSION cl_khr_fp64:enable
-#if __OPENCL_C_VERSION__ >= CL_VERSION_1_2
-// expected-warning@-2{{OpenCL extension 'cl_khr_fp64' is core feature or supported optional core feature - ignoring}}
-#endif
#endif
void atomic_types_test() {
@@ -47,14 +44,15 @@ void atomic_types_test() {
// expected-error@-28 {{use of type 'atomic_ulong' (aka '_Atomic(unsigned long)') requires cl_khr_int64_extended_atomics extension to be enabled}}
// expected-error@-27 {{use of type 'atomic_double' (aka '_Atomic(double)') requires cl_khr_int64_base_atomics extension to be enabled}}
// expected-error@-28 {{use of type 'atomic_double' (aka '_Atomic(double)') requires cl_khr_int64_extended_atomics extension to be enabled}}
-// expected-error-re@-27 {{use of type 'atomic_intptr_t' (aka '_Atomic({{.+}})') requires cl_khr_int64_base_atomics extension to be enabled}}
-// expected-error-re@-28 {{use of type 'atomic_intptr_t' (aka '_Atomic({{.+}})') requires cl_khr_int64_extended_atomics extension to be enabled}}
-// expected-error-re@-28 {{use of type 'atomic_uintptr_t' (aka '_Atomic({{.+}})') requires cl_khr_int64_base_atomics extension to be enabled}}
-// expected-error-re@-29 {{use of type 'atomic_uintptr_t' (aka '_Atomic({{.+}})') requires cl_khr_int64_extended_atomics extension to be enabled}}
-// expected-error-re@-29 {{use of type 'atomic_size_t' (aka '_Atomic({{.+}})') requires cl_khr_int64_base_atomics extension to be enabled}}
-// expected-error-re@-30 {{use of type 'atomic_size_t' (aka '_Atomic({{.+}})') requires cl_khr_int64_extended_atomics extension to be enabled}}
-// expected-error-re@-30 {{use of type 'atomic_ptrdiff_t' (aka '_Atomic({{.+}})') requires cl_khr_int64_base_atomics extension to be enabled}}
-// expected-error-re@-31 {{use of type 'atomic_ptrdiff_t' (aka '_Atomic({{.+}})') requires cl_khr_int64_extended_atomics extension to be enabled}}
+// expected-error@-29 {{use of type 'atomic_double' (aka '_Atomic(double)') requires cl_khr_fp64 extension to be enabled}}
+// expected-error-re@-28 {{use of type 'atomic_intptr_t' (aka '_Atomic({{.+}})') requires cl_khr_int64_base_atomics extension to be enabled}}
+// expected-error-re@-29 {{use of type 'atomic_intptr_t' (aka '_Atomic({{.+}})') requires cl_khr_int64_extended_atomics extension to be enabled}}
+// expected-error-re@-29 {{use of type 'atomic_uintptr_t' (aka '_Atomic({{.+}})') requires cl_khr_int64_base_atomics extension to be enabled}}
+// expected-error-re@-30 {{use of type 'atomic_uintptr_t' (aka '_Atomic({{.+}})') requires cl_khr_int64_extended_atomics extension to be enabled}}
+// expected-error-re@-30 {{use of type 'atomic_size_t' (aka '_Atomic({{.+}})') requires cl_khr_int64_base_atomics extension to be enabled}}
+// expected-error-re@-31 {{use of type 'atomic_size_t' (aka '_Atomic({{.+}})') requires cl_khr_int64_extended_atomics extension to be enabled}}
+// expected-error-re@-31 {{use of type 'atomic_ptrdiff_t' (aka '_Atomic({{.+}})') requires cl_khr_int64_base_atomics extension to be enabled}}
+// expected-error-re@-32 {{use of type 'atomic_ptrdiff_t' (aka '_Atomic({{.+}})') requires cl_khr_int64_extended_atomics extension to be enabled}}
#endif
#ifdef CL20
diff --git a/clang/test/Parser/opencl-pragma.cl b/clang/test/Parser/opencl-pragma.cl
index b002b0854a4..4c48b2a496f 100644
--- a/clang/test/Parser/opencl-pragma.cl
+++ b/clang/test/Parser/opencl-pragma.cl
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -verify -pedantic -Wno-empty-translation-unit -fsyntax-only -triple spir-unknown-unknown
+// RUN: %clang_cc1 %s -verify -pedantic -Wno-empty-translation-unit -fsyntax-only
#pragma OPENCL EXTENSION cl_khr_fp16 : enable
diff --git a/clang/test/Parser/opencl-storage-class.cl b/clang/test/Parser/opencl-storage-class.cl
index a8ebc1af399..6316ba7701d 100644
--- a/clang/test/Parser/opencl-storage-class.cl
+++ b/clang/test/Parser/opencl-storage-class.cl
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -verify -fsyntax-only -triple spir-unknown-unknown
+// RUN: %clang_cc1 %s -verify -fsyntax-only
void test_storage_class_specs()
{
diff --git a/clang/test/SemaOpenCL/extension-fp64-cl1.1.cl b/clang/test/SemaOpenCL/extension-fp64-cl1.1.cl
new file mode 100644
index 00000000000..7e852ae70eb
--- /dev/null
+++ b/clang/test/SemaOpenCL/extension-fp64-cl1.1.cl
@@ -0,0 +1,19 @@
+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL1.1
+
+void f1(double da) { // expected-error {{type 'double' requires cl_khr_fp64 extension}}
+ double d; // expected-error {{type 'double' requires cl_khr_fp64 extension}}
+ (void) 1.0; // expected-warning {{double precision constant requires cl_khr_fp64}}
+}
+
+#pragma OPENCL EXTENSION cl_khr_fp64 : enable
+
+void f2(void) {
+ double d;
+ (void) 1.0;
+}
+
+#pragma OPENCL EXTENSION cl_khr_fp64 : disable
+
+void f3(void) {
+ double d; // expected-error {{type 'double' requires cl_khr_fp64 extension}}
+}
diff --git a/clang/test/SemaOpenCL/extension-fp64.cl b/clang/test/SemaOpenCL/extension-fp64.cl
new file mode 100644
index 00000000000..e0c2b1ea4b5
--- /dev/null
+++ b/clang/test/SemaOpenCL/extension-fp64.cl
@@ -0,0 +1,19 @@
+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only
+
+void f1(double da) { // expected-error {{type 'double' requires cl_khr_fp64 extension}}
+ double d; // expected-error {{type 'double' requires cl_khr_fp64 extension}}
+ (void) 1.0; // expected-warning {{double precision constant requires cl_khr_fp64}}
+}
+
+#pragma OPENCL EXTENSION cl_khr_fp64 : enable
+
+void f2(void) {
+ double d;
+ (void) 1.0;
+}
+
+#pragma OPENCL EXTENSION cl_khr_fp64 : disable
+
+void f3(void) {
+ double d; // expected-error {{type 'double' requires cl_khr_fp64 extension}}
+}
diff --git a/clang/test/SemaOpenCL/extensions.cl b/clang/test/SemaOpenCL/extensions.cl
deleted file mode 100644
index 31224e0df77..00000000000
--- a/clang/test/SemaOpenCL/extensions.cl
+++ /dev/null
@@ -1,36 +0,0 @@
-// RUN: %clang_cc1 %s -triple spir-unknown-unknown -verify -pedantic -fsyntax-only
-// RUN: %clang_cc1 %s -triple spir-unknown-unknown -verify -pedantic -fsyntax-only -cl-std=CL1.1
-
-// Test with a target not supporting fp64.
-// RUN: %clang_cc1 %s -triple r600-unknown-unknown -target-cpu r600 -verify -pedantic -fsyntax-only -DNOFP64
-
-void f1(double da) { // expected-error {{type 'double' requires cl_khr_fp64 extension}}
- double d; // expected-error {{type 'double' requires cl_khr_fp64 extension}}
- (void) 1.0; // expected-warning {{double precision constant requires cl_khr_fp64}}
-}
-
-#pragma OPENCL EXTENSION cl_khr_fp64 : enable
-#ifdef NOFP64
-// expected-warning@-2{{unsupported OpenCL extension 'cl_khr_fp64' - ignoring}}
-#endif
-
-void f2(void) {
- double d;
-#ifdef NOFP64
-// expected-error@-2{{use of type 'double' requires cl_khr_fp64 extension to be enabled}}
-#endif
-
- (void) 1.0;
-#ifdef NOFP64
-// expected-warning@-2{{double precision constant requires cl_khr_fp64, casting to single precision}}
-#endif
-}
-
-#pragma OPENCL EXTENSION cl_khr_fp64 : disable
-#ifdef NOFP64
-// expected-warning@-2{{unsupported OpenCL extension 'cl_khr_fp64' - ignoring}}
-#endif
-
-void f3(void) {
- double d; // expected-error {{type 'double' requires cl_khr_fp64 extension}}
-}
diff --git a/clang/test/SemaOpenCL/half.cl b/clang/test/SemaOpenCL/half.cl
index dd7bb9ab8c5..f8cc017bb85 100644
--- a/clang/test/SemaOpenCL/half.cl
+++ b/clang/test/SemaOpenCL/half.cl
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -Wno-unused-value -triple spir-unknown-unknown
+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -Wno-unused-value
#pragma OPENCL EXTENSION cl_khr_fp16 : disable
constant float f = 1.0h; // expected-error{{half precision constant requires cl_khr_fp16}}
diff --git a/clang/test/SemaOpenCL/invalid-kernel-parameters.cl b/clang/test/SemaOpenCL/invalid-kernel-parameters.cl
index e2e48e83c6b..a30a27faa91 100644
--- a/clang/test/SemaOpenCL/invalid-kernel-parameters.cl
+++ b/clang/test/SemaOpenCL/invalid-kernel-parameters.cl
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s -triple spir-unknown-unknown
+// RUN: %clang_cc1 -fsyntax-only -verify %s
#pragma OPENCL EXTENSION cl_khr_fp16 : enable
diff --git a/clang/test/SemaOpenCL/invalid-logical-ops-1.2.cl b/clang/test/SemaOpenCL/invalid-logical-ops-1.2.cl
index 96602ce6844..7ba1adbf53e 100644
--- a/clang/test/SemaOpenCL/invalid-logical-ops-1.2.cl
+++ b/clang/test/SemaOpenCL/invalid-logical-ops-1.2.cl
@@ -1,7 +1,6 @@
// RUN: %clang_cc1 %s -verify -cl-std=CL1.2 -triple x86_64-unknown-linux-gnu
-#pragma OPENCL EXTENSION cl_khr_fp64 : enable // expected-warning{{OpenCL extension 'cl_khr_fp64' is core feature or supported optional core feature - ignoring}}
-
+#pragma OPENCL EXTENSION cl_khr_fp64 : enable
typedef __attribute__((ext_vector_type(4))) float float4;
typedef __attribute__((ext_vector_type(4))) double double4;
typedef __attribute__((ext_vector_type(4))) int int4;
diff --git a/clang/test/SemaOpenCL/optional-core-fp64-cl1.2.cl b/clang/test/SemaOpenCL/optional-core-fp64-cl1.2.cl
new file mode 100644
index 00000000000..e0f7f1db4ff
--- /dev/null
+++ b/clang/test/SemaOpenCL/optional-core-fp64-cl1.2.cl
@@ -0,0 +1,20 @@
+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL1.2
+// expected-no-diagnostics
+
+void f1(double da) {
+ double d;
+ (void) 1.0;
+}
+
+#pragma OPENCL EXTENSION cl_khr_fp64 : enable
+
+void f2(void) {
+ double d;
+ (void) 1.0;
+}
+
+#pragma OPENCL EXTENSION cl_khr_fp64 : disable
+
+void f3(void) {
+ double d;
+}
diff --git a/clang/test/SemaOpenCL/optional-core-fp64-cl2.0.cl b/clang/test/SemaOpenCL/optional-core-fp64-cl2.0.cl
new file mode 100644
index 00000000000..832529d4adf
--- /dev/null
+++ b/clang/test/SemaOpenCL/optional-core-fp64-cl2.0.cl
@@ -0,0 +1,20 @@
+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL2.0
+// expected-no-diagnostics
+
+void f1(double da) {
+ double d;
+ (void) 1.0;
+}
+
+#pragma OPENCL EXTENSION cl_khr_fp64 : enable
+
+void f2(void) {
+ double d;
+ (void) 1.0;
+}
+
+#pragma OPENCL EXTENSION cl_khr_fp64 : disable
+
+void f3(void) {
+ double d;
+}
OpenPOWER on IntegriCloud