aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp23/attr-assume12.C
blob: c955cd1d1e83f1c31c132137dec601b2a750bf23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// PR middle-end/110754
// { dg-do compile { target c++11 } }
// { dg-options "-O2 -fdump-tree-optimized" }
// { dg-final { scan-tree-dump-times "a ={v} x" 1 "optimized" } }
// { dg-final { scan-tree-dump-not "={v} a" "optimized" } }
// { dg-final { scan-tree-dump-times "return 0;" 1 "optimized" } }

int
foo (int x)
{
  volatile int a = x;
  [[gnu::assume (x == (a & 0))]];
  return x;
}