| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-std=gnu++11" } */ |
| 3 |
|
| 4 |
using size_t = typeof(sizeof(0)); |
| 5 |
template <typename T, size_t N> |
| 6 |
struct array { |
| 7 |
constexpr size_t size () const { return N; } |
| 8 |
constexpr const T *data () const { return a; } |
| 9 |
const T a[N]; |
| 10 |
}; |
| 11 |
|
| 12 |
void f() |
| 13 |
{ |
| 14 |
int a; |
| 15 |
asm((array<char, 3> {'f','o','o'}) : |
| 16 |
(array<char, 2>{'=','r'}) (a) : |
| 17 |
(array<char, 1>{'r'}) (1) : |
| 18 |
(array<char, 6>{'m','e','m','o','r','y'})); |
| 19 |
} |
| 20 |
|
| 21 |
/* { dg-final { scan-assembler "foo" } } */ |