summaryrefslogtreecommitdiff
path: root/test/SemaOpenCL/format-strings-fixit.cl
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2019-01-19 10:04:05 +0000
committerDimitry Andric <dim@FreeBSD.org>2019-01-19 10:04:05 +0000
commit676fbe8105eeb6ff4bb2ed261cb212fcfdbe7b63 (patch)
tree02a1ac369cb734d0abfa5000dd86e5b7797e6a74 /test/SemaOpenCL/format-strings-fixit.cl
parentc7e70c433efc6953dc3888b9fbf9f3512d7da2b0 (diff)
Diffstat (limited to 'test/SemaOpenCL/format-strings-fixit.cl')
-rw-r--r--test/SemaOpenCL/format-strings-fixit.cl24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/SemaOpenCL/format-strings-fixit.cl b/test/SemaOpenCL/format-strings-fixit.cl
new file mode 100644
index 0000000000000..b9f949ffe2fcd
--- /dev/null
+++ b/test/SemaOpenCL/format-strings-fixit.cl
@@ -0,0 +1,24 @@
+// RUN: cp %s %t
+// RUN: %clang_cc1 -cl-std=CL1.2 -pedantic -Wall -fixit %t
+// RUN: %clang_cc1 -cl-std=CL1.2 -fsyntax-only -pedantic -Wall -Werror %t
+// RUN: %clang_cc1 -cl-std=CL1.2 -E -o - %t | FileCheck %s
+
+typedef __attribute__((ext_vector_type(4))) int int4;
+typedef __attribute__((ext_vector_type(8))) int int8;
+
+int printf(__constant const char* st, ...) __attribute__((format(printf, 1, 2)));
+
+
+void vector_fixits() {
+ printf("%v4f", (int4) 123);
+ // CHECK: printf("%v4d", (int4) 123);
+
+ printf("%v8d", (int4) 123);
+ // CHECK: printf("%v4d", (int4) 123);
+
+ printf("%v4d", (int8) 123);
+ // CHECK: printf("%v8d", (int8) 123);
+
+ printf("%v4f", (int8) 123);
+ // CHECK: printf("%v8d", (int8) 123);
+}