Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/c-c++-common/spec-barrier-2.c @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | 84e7813d76e9 |
children |
rev | line source |
---|---|
131 | 1 /* { dg-do run } */ |
145 | 2 /* { dg-additional-options "-Wno-volatile" { target c++ } } */ |
131 | 3 |
4 /* Even on targets that don't need the optional failval parameter, | |
5 side-effects on the operand should still be calculated. */ | |
6 | |
7 int x = 3; | |
8 volatile int y = 9; | |
9 | |
10 int main () | |
11 { | |
12 int z = __builtin_speculation_safe_value (x, y++); | |
13 if (z != 3 || y != 10) | |
14 __builtin_abort (); | |
15 return 0; | |
16 } | |
17 | |
18 /* { dg-prune-output "this target does not define a speculation barrier;" } */ |