aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/spec-barrier-3.c
blob: 3ed4d39061a4fac0990a0790628d602f6ed3217a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
/* { dg-do compile } */
/* { dg-options "-Wpedantic" } */

/* __builtin_speculation_safe_value returns a value with the same type
   as its first argument.  There should be a warning if that isn't
   type-compatible with the use.  */
int *
f (int x)
{
  return __builtin_speculation_safe_value (x);  /* { dg-warning "returning 'int' from a function with return type 'int \\*' makes pointer from integer without a cast" } */
}

/* { dg-prune-output "this target does not define a speculation barrier;" } */