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