annotate clang/test/FixIt/fixit-pragma-attribute.cpp @ 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: not %clang_cc1 -fsyntax-only -fdiagnostics-parseable-fixits -Wno-pragma-clang-attribute %s 2>&1 | FileCheck %s
anatofuz
parents:
diff changeset
2
anatofuz
parents:
diff changeset
3 #pragma clang attribute push (annotate)
anatofuz
parents:
diff changeset
4 // CHECK: fix-it:{{.*}}:{[[@LINE-1]]:31-[[@LINE-1]]:31}:"__attribute__(("
anatofuz
parents:
diff changeset
5 // CHECK: fix-it:{{.*}}:{[[@LINE-2]]:39-[[@LINE-2]]:39}:"))"
anatofuz
parents:
diff changeset
6 #pragma clang attribute push (annotate(("test")))
anatofuz
parents:
diff changeset
7 // CHECK: fix-it:{{.*}}:{[[@LINE-1]]:31-[[@LINE-1]]:31}:"__attribute__(("
anatofuz
parents:
diff changeset
8 // CHECK: fix-it:{{.*}}:{[[@LINE-2]]:49-[[@LINE-2]]:49}:"))"
anatofuz
parents:
diff changeset
9
anatofuz
parents:
diff changeset
10 #pragma clang attribute push(__attribute__((annotate("test"))), apply_to = any( enum, function, function, namespace, function ))
anatofuz
parents:
diff changeset
11 // CHECK: fix-it:{{.*}}:{[[@LINE-1]]:97-[[@LINE-1]]:107}:""
anatofuz
parents:
diff changeset
12 // CHECK: fix-it:{{.*}}:{[[@LINE-2]]:118-[[@LINE-2]]:127}:""
anatofuz
parents:
diff changeset
13
anatofuz
parents:
diff changeset
14 #pragma clang attribute push(__attribute__((annotate("test"))), apply_to = any( variable(is_global), function, variable(is_global), variable(is_global) ))
anatofuz
parents:
diff changeset
15 // CHECK: fix-it:{{.*}}:{[[@LINE-1]]:112-[[@LINE-1]]:133}:""
anatofuz
parents:
diff changeset
16 // CHECK: fix-it:{{.*}}:{[[@LINE-2]]:133-[[@LINE-2]]:153}:""
anatofuz
parents:
diff changeset
17
anatofuz
parents:
diff changeset
18 #pragma clang attribute push (__attribute__((annotate("subRuleContradictions"))), apply_to = any(variable, variable(is_parameter), function(is_member), variable(is_global)))
anatofuz
parents:
diff changeset
19 // CHECK: fix-it:{{.*}}:{[[@LINE-1]]:153-[[@LINE-1]]:172}:""
anatofuz
parents:
diff changeset
20 // CHECK: fix-it:{{.*}}:{[[@LINE-2]]:108-[[@LINE-2]]:132}:""
anatofuz
parents:
diff changeset
21
anatofuz
parents:
diff changeset
22 #pragma clang attribute pop
anatofuz
parents:
diff changeset
23
anatofuz
parents:
diff changeset
24 #pragma clang attribute push (__attribute__((annotate("subRuleContradictions2"))), apply_to = any(function(is_member),function))
anatofuz
parents:
diff changeset
25 // CHECK: fix-it:{{.*}}:{[[@LINE-1]]:99-[[@LINE-1]]:119}:""
anatofuz
parents:
diff changeset
26
anatofuz
parents:
diff changeset
27 #pragma clang attribute pop
anatofuz
parents:
diff changeset
28
anatofuz
parents:
diff changeset
29 #pragma clang attribute push (__attribute__((annotate("negatedSubRuleContradictions1"))), apply_to = any(variable(is_parameter), variable(unless(is_parameter))))
anatofuz
parents:
diff changeset
30 // CHECK: fix-it:{{.*}}:{[[@LINE-1]]:130-[[@LINE-1]]:160}:""
anatofuz
parents:
diff changeset
31 #pragma clang attribute pop
anatofuz
parents:
diff changeset
32
anatofuz
parents:
diff changeset
33 #pragma clang attribute push (__attribute__((annotate("negatedSubRuleContradictions2"))), apply_to = any(variable(unless(is_parameter)), variable(is_thread_local), function, variable(is_global)))
anatofuz
parents:
diff changeset
34 // CHECK: fix-it:{{.*}}:{[[@LINE-1]]:106-[[@LINE-1]]:137}:""
anatofuz
parents:
diff changeset
35 #pragma clang attribute pop
anatofuz
parents:
diff changeset
36
anatofuz
parents:
diff changeset
37 #pragma clang attribute push (__attribute__((abi_tag("a"))), apply_to = any(enum, variable))
anatofuz
parents:
diff changeset
38 // CHECK: fix-it:{{.*}}:{[[@LINE-1]]:77-[[@LINE-1]]:82}:""
anatofuz
parents:
diff changeset
39 #pragma clang attribute pop
anatofuz
parents:
diff changeset
40
anatofuz
parents:
diff changeset
41 #pragma clang attribute push (__attribute__((abi_tag("a"))))
anatofuz
parents:
diff changeset
42 // CHECK: fix-it:{{.*}}:{[[@LINE-1]]:60-[[@LINE-1]]:60}:", apply_to = any(record(unless(is_union)), variable, function, namespace)"
anatofuz
parents:
diff changeset
43 #pragma clang attribute push (__attribute__((abi_tag("a"))) apply_to=function)
anatofuz
parents:
diff changeset
44 // CHECK: fix-it:{{.*}}:{[[@LINE-1]]:60-[[@LINE-1]]:60}:", "
anatofuz
parents:
diff changeset
45 #pragma clang attribute push (__attribute__((abi_tag("a"))) = function)
anatofuz
parents:
diff changeset
46 // CHECK: fix-it:{{.*}}:{[[@LINE-1]]:60-[[@LINE-1]]:60}:", apply_to"
anatofuz
parents:
diff changeset
47 #pragma clang attribute push (__attribute__((abi_tag("a"))) any(function))
anatofuz
parents:
diff changeset
48 // CHECK: fix-it:{{.*}}:{[[@LINE-1]]:60-[[@LINE-1]]:60}:", apply_to = "
anatofuz
parents:
diff changeset
49
anatofuz
parents:
diff changeset
50 #pragma clang attribute push (__attribute__((abi_tag("a"))) 22)
anatofuz
parents:
diff changeset
51 // CHECK: fix-it:{{.*}}:{[[@LINE-1]]:60-[[@LINE-1]]:63}:", apply_to = any(record(unless(is_union)), variable, function, namespace)"
anatofuz
parents:
diff changeset
52 #pragma clang attribute push (__attribute__((abi_tag("a"))) function)
anatofuz
parents:
diff changeset
53 // CHECK: fix-it:{{.*}}:{[[@LINE-1]]:60-[[@LINE-1]]:69}:", apply_to = any(record(unless(is_union)), variable, function, namespace)"
anatofuz
parents:
diff changeset
54 #pragma clang attribute push (__attribute__((abi_tag("a"))) (function))
anatofuz
parents:
diff changeset
55 // CHECK: fix-it:{{.*}}:{[[@LINE-1]]:60-[[@LINE-1]]:71}:", apply_to = any(record(unless(is_union)), variable, function, namespace)"
anatofuz
parents:
diff changeset
56
anatofuz
parents:
diff changeset
57 #pragma clang attribute push (__attribute__((abi_tag("a"))), )
anatofuz
parents:
diff changeset
58 // CHECK: fix-it:{{.*}}:{[[@LINE-1]]:61-[[@LINE-1]]:62}:"apply_to = any(record(unless(is_union)), variable, function, namespace)"
anatofuz
parents:
diff changeset
59 #pragma clang attribute push (__attribute__((abi_tag("a"))), = function)
anatofuz
parents:
diff changeset
60 // CHECK: fix-it:{{.*}}:{[[@LINE-1]]:61-[[@LINE-1]]:61}:"apply_to"
anatofuz
parents:
diff changeset
61 #pragma clang attribute push (__attribute__((abi_tag("a"))), any(function))
anatofuz
parents:
diff changeset
62 // CHECK: fix-it:{{.*}}:{[[@LINE-1]]:61-[[@LINE-1]]:61}:"apply_to = "
anatofuz
parents:
diff changeset
63
anatofuz
parents:
diff changeset
64 #pragma clang attribute push (__attribute__((abi_tag("a"))), 22)
anatofuz
parents:
diff changeset
65 // CHECK: fix-it:{{.*}}:{[[@LINE-1]]:61-[[@LINE-1]]:64}:"apply_to = any(record(unless(is_union)), variable, function, namespace)"
anatofuz
parents:
diff changeset
66 #pragma clang attribute push (__attribute__((abi_tag("a"))), 1, 2)
anatofuz
parents:
diff changeset
67 // CHECK: fix-it:{{.*}}:{[[@LINE-1]]:61-[[@LINE-1]]:66}:"apply_to = any(record(unless(is_union)), variable, function, namespace)"
anatofuz
parents:
diff changeset
68 #pragma clang attribute push (__attribute__((abi_tag("a"))), function)
anatofuz
parents:
diff changeset
69 // CHECK: fix-it:{{.*}}:{[[@LINE-1]]:61-[[@LINE-1]]:70}:"apply_to = any(record(unless(is_union)), variable, function, namespace)"
anatofuz
parents:
diff changeset
70 #pragma clang attribute push (__attribute__((abi_tag("a"))), (function))
anatofuz
parents:
diff changeset
71 // CHECK: fix-it:{{.*}}:{[[@LINE-1]]:61-[[@LINE-1]]:72}:"apply_to = any(record(unless(is_union)), variable, function, namespace)"
anatofuz
parents:
diff changeset
72
anatofuz
parents:
diff changeset
73 #pragma clang attribute push (__attribute__((abi_tag("a"))), apply_to)
anatofuz
parents:
diff changeset
74 // CHECK: fix-it:{{.*}}:{[[@LINE-1]]:70-[[@LINE-1]]:70}:" = any(record(unless(is_union)), variable, function, namespace)"
anatofuz
parents:
diff changeset
75 #pragma clang attribute push (__attribute__((abi_tag("a"))), apply_to any(function))
anatofuz
parents:
diff changeset
76 // CHECK: fix-it:{{.*}}:{[[@LINE-1]]:70-[[@LINE-1]]:70}:" = "
anatofuz
parents:
diff changeset
77
anatofuz
parents:
diff changeset
78 #pragma clang attribute push (__attribute__((abi_tag("a"))), apply_to 41 (22))
anatofuz
parents:
diff changeset
79 // CHECK: fix-it:{{.*}}:{[[@LINE-1]]:70-[[@LINE-1]]:78}:" = any(record(unless(is_union)), variable, function, namespace)"
anatofuz
parents:
diff changeset
80
anatofuz
parents:
diff changeset
81 // Don't give fix-it to attributes without a strict subject set
anatofuz
parents:
diff changeset
82 #pragma clang attribute push (__attribute__((annotate("a"))))
anatofuz
parents:
diff changeset
83 // CHECK-NO: [[@LINE-1]]:61