[RISC-V] Avoid unnecessary extensions when value is already extended
[official-gcc.git] / gcc / testsuite / gdc.dg / asm4.d
blobdb857af7e36ffe3180696231ba28a95abb4edfed
1 // https://issues.dlang.org/show_bug.cgi?id=12979
2 // { dg-do compile }
3 // { dg-options "-Wall -Wdeprecated -Werror" }
4 module asm4;
6 void test1()
8 asm pure nothrow @nogc @trusted {}
9 asm @system {}
12 void test2() pure nothrow @nogc @safe
14 asm pure nothrow @nogc @trusted {}
17 void test3()()
19 asm pure nothrow @nogc @trusted {}
22 static assert(__traits(compiles, () pure nothrow @nogc @safe => test3()));
24 void test4()()
26 asm {}
29 // wait for deprecation of asm pure inference
30 // static assert(!__traits(compiles, () pure => test4()));
31 static assert(!__traits(compiles, () nothrow => test4()));
32 // wait for deprecation of asm @nogc inference
33 // static assert(!__traits(compiles, () @nogc => test4()));
34 static assert(!__traits(compiles, () @safe => test4()));
36 @safe
37 void test5()
39 static assert(!__traits(compiles, { asm { ""; } }() ));