annotate clang/test/Sema/aarch64-vpcs.c @ 222:81f6424ef0e3 llvm-original

LLVM original branch
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 18 Jul 2021 22:10:01 +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 aarch64-linux-gnu -verify %s
anatofuz
parents:
diff changeset
2
anatofuz
parents:
diff changeset
3 typedef __attribute__((aarch64_vector_pcs)) int invalid_typedef; // expected-warning {{'aarch64_vector_pcs' only applies to function types; type here is 'int'}}
anatofuz
parents:
diff changeset
4
anatofuz
parents:
diff changeset
5 void __attribute__((aarch64_vector_pcs(0))) foo0(void); // expected-error {{'aarch64_vector_pcs' attribute takes no arguments}}
anatofuz
parents:
diff changeset
6
anatofuz
parents:
diff changeset
7 void __attribute__((aarch64_vector_pcs, preserve_all)) foo1(void); // expected-error {{not compatible}}
anatofuz
parents:
diff changeset
8
anatofuz
parents:
diff changeset
9 void __attribute__((cdecl)) foo2(void); // expected-note {{previous declaration is here}}
anatofuz
parents:
diff changeset
10 void __attribute__((aarch64_vector_pcs)) foo2(void) {} // expected-error {{function declared 'aarch64_vector_pcs' here was previously declared 'cdecl'}}
anatofuz
parents:
diff changeset
11
anatofuz
parents:
diff changeset
12 void foo3(void); // expected-note {{previous declaration is here}}
anatofuz
parents:
diff changeset
13 void __attribute__((aarch64_vector_pcs)) foo3(void) {} // expected-error {{function declared 'aarch64_vector_pcs' here was previously declared without calling convention}}
anatofuz
parents:
diff changeset
14
anatofuz
parents:
diff changeset
15 typedef int (*fn_ty)(void);
anatofuz
parents:
diff changeset
16 typedef int __attribute__((aarch64_vector_pcs)) (*aavpcs_fn_ty)(void);
anatofuz
parents:
diff changeset
17 void foo4(fn_ty ptr1, aavpcs_fn_ty ptr2) {
anatofuz
parents:
diff changeset
18 ptr1 = ptr2; // expected-warning {{incompatible function pointer types}}
anatofuz
parents:
diff changeset
19 }