blob: 2b9c5cc3f319f22c69286e7d64c3c7ea62be1055 [file] [log] [blame]
Matt Arsenaulta0115122018-10-03 02:01:19 +00001// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL2.0 -finclude-default-header
2
3// Make sure warnings are produced based on printf format strings.
4
5
6kernel void format_string_warnings(__constant char* arg) {
7
8 printf("%d", arg); // expected-warning {{format specifies type 'int' but the argument has type '__constant char *'}}
9
10 printf("not enough arguments %d %d", 4); // expected-warning {{more '%' conversions than data arguments}}
11
12 printf("too many arguments", 4); // expected-warning {{data argument not used by format string}}
13}