summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.dg/attr_target1.d
blob: 4cf89f34dda8c4c6a890ae878da8898161e810f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// { dg-do compile { target i?86*-*-* x86_64-*-* } }

import gcc.attributes;

@target("default")
int foo() { return 1; }

@target("arch=core2", "")
int foo2() { return 2; } // { dg-warning "empty string in attribute .target." }

@target("sse4.2", "", "")
int foo3() { return 3; } // { dg-warning "empty string in attribute .target." }

@target("default")
int var = 0; // { dg-warning ".target. attribute ignored" }

int main()
{
    return foo() + foo2() + foo3();
}