1f08c3bdfSopenharmony_ciint keep(volatile int *p) { return *p && 0; } 2f08c3bdfSopenharmony_ciint kill(int *p, int i) { return *p && 0; } 3f08c3bdfSopenharmony_civoid ind(volatile int *p,int i) { int v = i++; if (i && 0) p[v]; } 4f08c3bdfSopenharmony_ci 5f08c3bdfSopenharmony_ci 6f08c3bdfSopenharmony_ci/* 7f08c3bdfSopenharmony_ci * check-name: kill-load 8f08c3bdfSopenharmony_ci * check-command: test-linearize -Wno-decl $file 9f08c3bdfSopenharmony_ci * check-description: 10f08c3bdfSopenharmony_ci * Check that loads are optimized away but only 11f08c3bdfSopenharmony_ci * when needed: 12f08c3bdfSopenharmony_ci * - non-volatile 13f08c3bdfSopenharmony_ci * - bb unreachable. 14f08c3bdfSopenharmony_ci * 15f08c3bdfSopenharmony_ci * check-output-ignore 16f08c3bdfSopenharmony_ci * check-output-pattern(1): load\\. 17f08c3bdfSopenharmony_ci */ 18