aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp1z/constexpr-asm-6.C
blob: ca435f5ed45230f291af84625c8df6b8632c91bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/* { dg-do compile { target c++17 } } */
/* { dg-skip-if "requires hosted libstdc++ for string" { ! hostedlib } } */
// { dg-require-iconv "IBM1047" }
// { dg-options "-fexec-charset=IBM1047" }

#include <string>

constexpr std::string_view genfoo ()
{
  return "foo %1,%0";
}

constexpr std::string_view genoutput ()
{
  return "=r";
}

constexpr std::string_view geninput ()
{
  return "r";
}

constexpr std::string_view genclobber ()
{
  return "memory";
}

void f()
{
  int a;
  asm((genfoo ()) : (genoutput ()) (a) : (geninput ()) (1) : (genclobber ()));
}

/* { dg-final { scan-assembler "foo" } } */