aboutsummaryrefslogtreecommitdiff
path: root/test/SemaOpenCL
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2019-02-05 18:39:15 +0000
committerDimitry Andric <dim@FreeBSD.org>2019-02-05 18:39:15 +0000
commitd87c9e7da2e87f224c426832f08897269c2e5636 (patch)
tree9492632723d36c1c80f3daca3974f362eea84a7a /test/SemaOpenCL
parent292698a8537d1e51bbcd339f8a19b2b7d7f1e1f6 (diff)
Notes
Diffstat (limited to 'test/SemaOpenCL')
-rw-r--r--test/SemaOpenCL/printf-format-string-warnings.cl9
-rw-r--r--test/SemaOpenCL/printf-format-strings.cl4
2 files changed, 7 insertions, 6 deletions
diff --git a/test/SemaOpenCL/printf-format-string-warnings.cl b/test/SemaOpenCL/printf-format-string-warnings.cl
index 2b9c5cc3f319..39b859402702 100644
--- a/test/SemaOpenCL/printf-format-string-warnings.cl
+++ b/test/SemaOpenCL/printf-format-string-warnings.cl
@@ -1,13 +1,14 @@
// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL2.0 -finclude-default-header
-// Make sure warnings are produced based on printf format strings.
+// FIXME: Make sure warnings are produced based on printf format strings.
+// expected-no-diagnostics
kernel void format_string_warnings(__constant char* arg) {
- printf("%d", arg); // expected-warning {{format specifies type 'int' but the argument has type '__constant char *'}}
+ printf("%d", arg);
- printf("not enough arguments %d %d", 4); // expected-warning {{more '%' conversions than data arguments}}
+ printf("not enough arguments %d %d", 4);
- printf("too many arguments", 4); // expected-warning {{data argument not used by format string}}
+ printf("too many arguments", 4);
}
diff --git a/test/SemaOpenCL/printf-format-strings.cl b/test/SemaOpenCL/printf-format-strings.cl
index 079a83495685..212e1f8981cb 100644
--- a/test/SemaOpenCL/printf-format-strings.cl
+++ b/test/SemaOpenCL/printf-format-strings.cl
@@ -13,10 +13,10 @@ int printf(__constant const char* st, ...) __attribute__((format(printf, 1, 2)))
kernel void format_v4f32(float4 arg)
{
#ifdef cl_khr_fp64
- printf("%v4f\n", arg);
+ printf("%v4f\n", arg); // expected-warning{{format specifies type 'double __attribute__((ext_vector_type(4)))' but the argument has type 'float4' (vector of 4 'float' values)}}
// Precision modifier
- printf("%.2v4f\n", arg);
+ printf("%.2v4f\n", arg); // expected-warning{{format specifies type 'double __attribute__((ext_vector_type(4)))' but the argument has type 'float4' (vector of 4 'float' values)}}
#else
// FIXME: These should not warn, and the type should be expected to be float.
printf("%v4f\n", arg); // expected-warning {{double __attribute__((ext_vector_type(4)))' but the argument has type 'float4' (vector of 4 'float' values)}}