aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp2a/inline-asm1.C
blob: a7835c7199e057b2036cd866bd5995c244b16d7e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// P1668R1: Permit unevaluated inline asm in constexpr functions
// PR c++/91346
// { dg-do compile { target c++14 } }
// { dg-options "" }

constexpr int
foo (int a, int b)
{
  if (__builtin_is_constant_evaluated ())
    return a + b;
  asm (""); // { dg-warning ".asm. in .constexpr. function only available with" "" { target c++17_down } }
  return a;
}