Debian Codegraph @

gcc/testsuite/g++.dg/cpp1z/constexpr-asm-3.C

raw
1 /* { dg-do compile } */
2 /* { dg-options "-std=gnu++17" } */
3 /* { dg-skip-if "requires hosted libstdc++ for string" { ! hostedlib } } */
4
5 #include <string>
6
7 constexpr std::string_view genfoo ()
8 {
9 return "foo %1,%0";
10 }
11
12 constexpr std::string_view genoutput ()
13 {
14 return "=r";
15 }
16
17 constexpr std::string_view geninput ()
18 {
19 return "r";
20 }
21
22 constexpr std::string_view genclobber ()
23 {
24 return "memory";
25 }
26
27 void f()
28 {
29 int a;
30 asm(genfoo () : /* { dg-error "expected string-literal or constexpr in parentheses" } */
31 genoutput() (a) :
32 geninput() (1) :
33 genclobber());
34 }