annotate clang/test/Sema/attr-standalonedebug.cpp @ 207:2e18cbf3894f

LLVM12
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 08 Jun 2021 06:07:14 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
207
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 // RUN: %clang_cc1 %s -verify -fsyntax-only
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 // RUN: %clang_cc1 %s -verify -fsyntax-only -x c
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
3
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 #ifdef __cplusplus
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 int a __attribute__((standalone_debug)); // expected-warning {{'standalone_debug' attribute only applies to classes}}
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
6
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 void __attribute__((standalone_debug)) b(); // expected-warning {{'standalone_debug' attribute only applies to classes}}
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
8
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 struct __attribute__((standalone_debug(1))) c {}; // expected-error {{'standalone_debug' attribute takes no arguments}}
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 #else
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 // Check that attribute only works in C++.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 struct __attribute__((standalone_debug)) a {}; // expected-warning {{'standalone_debug' attribute ignored}}
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 #endif