brintos

brintos / llvm-project-archived public Read only

0
0
Text · 578 B · af49051 Raw
13 lines · plain
1// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL2.0 -finclude-default-header -fdeclare-opencl-builtins2 3// Make sure warnings are produced based on printf format strings.4 5kernel void format_string_warnings(__constant char* arg) {6 7  printf("%d", arg); // expected-warning {{format specifies type 'int' but the argument has type '__constant char *'}}8 9  printf("not enough arguments %d %d", 4); // expected-warning {{more '%' conversions than data arguments}}10 11  printf("too many arguments", 4); // expected-warning {{data argument not used by format string}}12}13