annotate clang/test/Sema/attr-guard_nocf.c @ 207:2e18cbf3894f

LLVM12
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 08 Jun 2021 06:07:14 +0900
parents 1d019706d866
children c4bab56944e8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: %clang_cc1 -triple %ms_abi_triple -fms-extensions -verify -fsyntax-only %s
anatofuz
parents:
diff changeset
2 // RUN: %clang_cc1 -triple %ms_abi_triple -fms-extensions -verify -std=c++11 -fsyntax-only -x c++ %s
anatofuz
parents:
diff changeset
3
anatofuz
parents:
diff changeset
4 // Function definition.
anatofuz
parents:
diff changeset
5 __declspec(guard(nocf)) void testGuardNoCF() { // no warning
anatofuz
parents:
diff changeset
6 }
anatofuz
parents:
diff changeset
7
anatofuz
parents:
diff changeset
8 // Can not be used on variable, parameter, or function pointer declarations.
anatofuz
parents:
diff changeset
9 int __declspec(guard(nocf)) i; // expected-warning {{'guard' attribute only applies to functions}}
anatofuz
parents:
diff changeset
10 void testGuardNoCFFuncParam(double __declspec(guard(nocf)) i) {} // expected-warning {{'guard' attribute only applies to functions}}
anatofuz
parents:
diff changeset
11 __declspec(guard(nocf)) typedef void (*FuncPtrWithGuardNoCF)(void); // expected-warning {{'guard' attribute only applies to functions}}
anatofuz
parents:
diff changeset
12
anatofuz
parents:
diff changeset
13 // 'guard' Attribute requries an argument.
anatofuz
parents:
diff changeset
14 __declspec(guard) void testGuardNoCFParams() { // expected-error {{'guard' attribute takes one argument}}
anatofuz
parents:
diff changeset
15 }
anatofuz
parents:
diff changeset
16
anatofuz
parents:
diff changeset
17 // 'guard' Attribute requries an identifier as argument.
anatofuz
parents:
diff changeset
18 __declspec(guard(1)) void testGuardNoCFParamType() { // expected-error {{'guard' attribute requires an identifier}}
anatofuz
parents:
diff changeset
19 }
anatofuz
parents:
diff changeset
20
anatofuz
parents:
diff changeset
21 // 'guard' Attribute only takes a single argument.
anatofuz
parents:
diff changeset
22 __declspec(guard(nocf, nocf)) void testGuardNoCFTooManyParams() { // expected-error {{use of undeclared identifier 'nocf'}}
anatofuz
parents:
diff changeset
23 }
anatofuz
parents:
diff changeset
24
anatofuz
parents:
diff changeset
25 // 'guard' Attribute argument must be a supported identifier.
anatofuz
parents:
diff changeset
26 __declspec(guard(cf)) void testGuardNoCFInvalidParam() { // expected-warning {{'guard' attribute argument not supported: 'cf'}}
anatofuz
parents:
diff changeset
27 }