blob: c14b19d3479598a4580f9f3b297b81076601a5f6 (
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
|
/* Wide string literals should not be allowed in asm. */
/* Origin: Joseph Myers <joseph@codesourcery.com> */
/* { dg-do compile } */
/* { dg-options "" } */
int foo asm (L"bar"); /* { dg-error "14:wide string literal in 'asm'" } */
asm (L"foo"); /* { dg-error "6:wide string literal in 'asm'" } */
void
f (void)
{
int x = 1;
asm (L"foo"); /* { dg-error "8:wide string literal in 'asm'" } */
asm ("foo" :
L"=g" (x)); /* { dg-error "8:wide string literal in 'asm'" } */
asm ("foo" : [x]
L"=g" (x)); /* { dg-error "8:wide string literal in 'asm'" } */
asm ("foo" : [x] "=g" (x),
L"=g" (x)); /* { dg-error "8:wide string literal in 'asm'" } */
asm ("foo" : :
L"g" (x)); /* { dg-error "8:wide string literal in 'asm'" } */
asm ("foo" : : :
L"memory"); /* { dg-error "8:wide string literal in 'asm'" } */
asm ("foo" : : : "memory",
L"memory"); /* { dg-error "8:wide string literal in 'asm'" } */
}
/* Extra errors from the substitution of "" for wide strings: */
/* { dg-error "output" "output" { target *-*-* } 16 } */
/* { dg-error "output" "output" { target *-*-* } 18 } */
/* { dg-error "output" "output" { target *-*-* } 20 } */
|