gcc/testsuite/gdc.dg/attr_noclone1.d
raw| 1 | /* { dg-do compile } */ |
| 2 | /* { dg-options "-O2" } */ |
| 3 | |
| 4 | import gcc.attributes; |
| 5 | |
| 6 | @target_clones("avx", "default") |
| 7 | @noclone |
| 8 | void func() // { dg-error "clones for .target_clones. attribute cannot be created" } |
| 9 | { // { dg-message "function .func. can never be copied because it has .noclone. attribute" "" { target *-*-* } .-1 } |
| 10 | } |
| 11 | |
| 12 | @noclone int var = 0; // { dg-warning ".noclone. attribute ignored" } |