summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.dg/asm4.d
blob: e243c0820ac8ef001ca92c0126203a1a7578c023 (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
33
34
35
36
37
38
39
40
// https://issues.dlang.org/show_bug.cgi?id=12979
// { dg-do compile }
// { dg-options "-Wall -Wdeprecated -Werror" }
module asm4;

void test1()
{
    asm pure nothrow @nogc @trusted {}
    asm @safe {}
}

void test2() pure nothrow @nogc @safe
{
    asm pure nothrow @nogc @trusted {}
}

void test3()()
{
    asm pure nothrow @nogc @trusted {}
}

static assert(__traits(compiles, () pure nothrow @nogc @safe => test3()));

void test4()()
{
    asm {}
}

// wait for deprecation of asm pure inference
// static assert(!__traits(compiles, () pure => test4()));
static assert(!__traits(compiles, () nothrow => test4()));
// wait for deprecation of asm @nogc inference
// static assert(!__traits(compiles, () @nogc => test4()));
static assert(!__traits(compiles, () @safe => test4()));

@safe
void test5()
{
    static assert(!__traits(compiles, { asm { ""; } }() ));
}