1 // RUN: %clang_analyze_cc1 -triple amdgcn-unknown-unknown \
2 // RUN: -analyze -analyzer-checker=core -DAMDGCN_TRIPLE \
3 // RUN: -analyze -analyzer-checker=debug.ExprInspection \
4 // RUN: -Wno-implicit-int -Wno-int-conversion -verify %s
6 // RUN: %clang_analyze_cc1 -triple amdgcn-unknown-unknown \
7 // RUN: -analyze -analyzer-checker=core -DDEFAULT_TRIPLE \
8 // RUN: -analyze -analyzer-checker=debug.ExprInspection \
9 // RUN: -Wno-implicit-int -Wno-int-conversion -verify %s
11 // From https://llvm.org/docs/AMDGPUUsage.html#address-spaces,
12 // select address space 3 (local), since the pointer size is
13 // different than Generic.
15 // expected-no-diagnostics
17 #define DEVICE __attribute__((address_space(3)))
19 #if defined(AMDGCN_TRIPLE)
23 DEVICE
int *dptr
= val
;
24 return dptr
== (void *)0;
30 DEVICE
int *dptr
= val
;
31 return dptr
== (DEVICE
void *)0;
38 return dptr
== (DEVICE
void *)0;
46 return dptr
== (void *)0;