Require target lra in gcc.dg/pr108095.c
[official-gcc.git] / gcc / testsuite / gdc.dg / asm1.d
blob1b249ee7b35e9984507f2cd58bd936bb6d1cac5d
1 // { dg-do compile }
2 module asm1;
4 void parse1()
6 asm
8 ""h; // { dg-error "found 'h' when expecting ':'" }
12 void parse2()
14 asm
16 "" : : "g" (1 ? 2 : 3);
17 "" : : "g" (1 ? 2 : :) 3;
18 // { dg-error "expression expected, not ':'" "" { target *-*-* } .-1 }
19 // { dg-error "expected constant string constraint for operand" "" { target *-*-* } .-2 }
23 void parse3()
25 asm { "" [; }
26 // { dg-error "expression expected, not ';'" "" { target *-*-* } .-1 }
27 // { dg-error "found 'End of File' when expecting ','" "" { target *-*-* } .-2 }
28 // { dg-error "found 'End of File' when expecting ']'" "" { target *-*-* } .-3 }
29 // { dg-error "found 'End of File' when expecting ';'" "" { target *-*-* } .-4 }
32 void parse4()
34 int expr;
35 asm
37 "%name" : [name] string (expr); // { dg-error "expected constant string constraint for operand, not 'string'" }
41 void semantic1()
44 int one;
45 L1:
48 asm { "" : : : : L1, L2; }
49 // { dg-error "'goto' skips declaration of variable 'asm1.semantic1.one'" "" { target *-*-* } .-1 }
50 // { dg-error "'goto' skips declaration of variable 'asm1.semantic1.two'" "" { target *-*-* } .-2 }
52 int two;
53 L2:
58 void semantic2a(X...)(X expr)
60 alias X[0] var1;
61 asm { "%0" : "=m" (var1); } // { dg-error "double' is a 'double' definition and cannot be modified" }
64 void semantic2()
66 semantic2a(3.6); // { dg-error "template instance 'asm1.semantic2a!double' error instantiating" }
69 void semantic3()
71 asm
73 unknown; // { dg-error "undefined identifier 'unknown'" }
77 struct S4
79 template opDispatch(string Name, P...)
81 static void opDispatch(P) {}
85 void semantic4()
87 asm
89 "%0" : : "m" (S4.foo); // { dg-error "template instance 'opDispatch!\"foo\"' has no value" }