llvm-project/clang/test/Sema/check-increment.c
Timm Bäder a9e830910b [clang][Interp] Protect Inc/Dec ops against dummy pointers
We create them more often in C, so it's more likely to happen there.
2024-02-01 08:03:49 +01:00

13 lines
290 B
C

// RUN: %clang_cc1 -fsyntax-only -verify %s
// RUN: %clang_cc1 -fsyntax-only -verify %s -fexperimental-new-constant-interpreter
// expected-no-diagnostics
int printf(const char *, ...);
typedef int *pint;
int main(void) {
int a[5] = {0};
pint p = a;
p++;
printf("%d\n", *p);
}