diff options
Diffstat (limited to 'test/Analysis/ptr-cmp-const-trunc.cl')
-rw-r--r-- | test/Analysis/ptr-cmp-const-trunc.cl | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/Analysis/ptr-cmp-const-trunc.cl b/test/Analysis/ptr-cmp-const-trunc.cl new file mode 100644 index 0000000000..4483ef6839 --- /dev/null +++ b/test/Analysis/ptr-cmp-const-trunc.cl @@ -0,0 +1,11 @@ +//RUN: %clang_analyze_cc1 -triple amdgcn-unknown-unknown -analyze -analyzer-checker=core -verify %s +// expected-no-diagnostics + +#include <stdint.h> + +void bar(__global int *p) __attribute__((nonnull(1))); + +void foo(__global int *p) { + if ((uint64_t)p <= 1UL << 32) + bar(p); // no-warning +} |