1f08c3bdfSopenharmony_cistatic int a = 1; 2f08c3bdfSopenharmony_cistatic int b[2] = {1, 1}; 3f08c3bdfSopenharmony_ci 4f08c3bdfSopenharmony_cistatic int *c = &b[1]; // OK 5f08c3bdfSopenharmony_cistatic int *d = (int*)0 + 1; // OK 6f08c3bdfSopenharmony_cistatic int *e = &b[1] + 1; // OK 7f08c3bdfSopenharmony_cistatic int *f = b + 1; // OK 8f08c3bdfSopenharmony_cistatic int *g = d + 1; // KO 9f08c3bdfSopenharmony_cistatic int *h = &a + 1; // OK 10f08c3bdfSopenharmony_cistatic int *i = &b[1] + 1; // OK 11f08c3bdfSopenharmony_cistatic int *j = b + 1; // OK 12f08c3bdfSopenharmony_cistatic int *k = d + 1; // KO 13f08c3bdfSopenharmony_cistatic int *l = &*&b[1]; // OK 14f08c3bdfSopenharmony_cistatic int *m = &*(&a + 1); // OK 15f08c3bdfSopenharmony_cistatic int *n = &*(&b[1] + 1); // OK 16f08c3bdfSopenharmony_cistatic int *o = &*(b + 1); // OK 17f08c3bdfSopenharmony_cistatic int *p = &*(d + 1); // KO 18f08c3bdfSopenharmony_ci 19f08c3bdfSopenharmony_ci/* 20f08c3bdfSopenharmony_ci * check-name: consrexprness pointer arithmetic 21f08c3bdfSopenharmony_ci * check-command: sparse -Wconstexpr-not-const $file 22f08c3bdfSopenharmony_ci * 23f08c3bdfSopenharmony_ci * check-error-start 24f08c3bdfSopenharmony_ciconstexpr-pointer-arith.c:8:19: warning: non-constant initializer for static object 25f08c3bdfSopenharmony_ciconstexpr-pointer-arith.c:12:19: warning: non-constant initializer for static object 26f08c3bdfSopenharmony_ciconstexpr-pointer-arith.c:17:22: warning: non-constant initializer for static object 27f08c3bdfSopenharmony_ci * check-error-end 28f08c3bdfSopenharmony_ci */ 29