libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / signbit-2.c
blob5511bb7814988899017b7534933de16a6b52ada0
1 /* { dg-do compile } */
2 /* { dg-options "-O3 -fdump-tree-optimized" } */
4 /* This test does not work when the truth type does not match vector type. */
5 /* { dg-additional-options "-msse2 -mno-avx512f" { target { i?86-*-* x86_64-*-* } } } */
6 /* { dg-additional-options "-march=armv8-a" { target aarch64_sve } } */
7 /* { dg-additional-options "-maltivec" { target powerpc_altivec_ok } } */
8 /* { dg-additional-options "-mlsx" { target loongarch_sx } } */
9 /* { dg-skip-if "no fallback for MVE" { arm_mve } } */
11 #include <stdint.h>
13 void fun1(int32_t *x, int n)
15 for (int i = 0; i < (n & -16); i++)
16 x[i] = (-x[i]) >> 31;
19 void fun2(int32_t *x, int n)
21 for (int i = 0; i < (n & -16); i++)
22 x[i] = (-x[i]) >> 30;
25 /* Xfail amdgcn where vector truth type is not integer type. */
26 /* { dg-final { scan-tree-dump {\s+>\s+\{ 0(, 0)+ \}} optimized { target vect_shift xfail amdgcn-*-* } } } */
27 /* { dg-final { scan-tree-dump {\s+>\s+0} optimized { target { ! vect_shift } } } } */
28 /* { dg-final { scan-tree-dump-not {\s+>>\s+31} optimized { xfail amdgcn-*-* } } } */