Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / SemaOpenCL / printf-format-string-warnings.cl
blobaf490510855711f32ded56cd9df4b2bfc2bb7c8a
1 // RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL2.0 -finclude-default-header -fdeclare-opencl-builtins
3 // Make sure warnings are produced based on printf format strings.
5 kernel void format_string_warnings(__constant char* arg) {
7 printf("%d", arg); // expected-warning {{format specifies type 'int' but the argument has type '__constant char *'}}
9 printf("not enough arguments %d %d", 4); // expected-warning {{more '%' conversions than data arguments}}
11 printf("too many arguments", 4); // expected-warning {{data argument not used by format string}}