| 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 ()) : (genoutput ()) (a) : (geninput ()) (1) : (genclobber ())); |
| 31 |
} |
| 32 |
|
| 33 |
/* { dg-final { scan-assembler "foo" } } */ |