Skip to content
Snippets Groups Projects
Unverified Commit 26ca00ee authored by Sam James's avatar Sam James
Browse files

testsuite: torture: add LLVM testcase for DSE vs. -ftrivial-auto-var-init=

This testcase came up in a recent LLVM bug report [0] for DSE vs
-ftrivial-auto-var-init=. Add it to our testsuite given that area
could do with better coverage.

[0] https://github.com/llvm/llvm-project/issues/119646



gcc/testsuite/ChangeLog:

	* gcc.dg/torture/dse-trivial-auto-var-init.c: New test.

Co-authored-by: default avatarAndrew Pinski <pinskia@gmail.com>
parent c7754a2f
No related branches found
No related tags found
No related merge requests found
/* Testcase for LLVM bug: https://github.com/llvm/llvm-project/issues/119646 */
/* { dg-do run } */
/* { dg-additional-options "-ftrivial-auto-var-init=zero" } */
int b = 208;
[[gnu::noinline]]
void f(int *e, int a) {
*e = !!b;
if (a)
__builtin_trap();
}
int main(void) {
b = 0;
f(&b, 0);
if (b != 0)
__builtin_trap();
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment