// RUN: %clang_cc1 %s -fsyntax-only -triple x86_64-unknown-unknown -verify
// RUN: %clang_cc1 %s -fsyntax-only -triple arm64-unknown-unknown -verify
// RUN: %clang_cc1 %s -fsyntax-only -triple x86_64-unknown-windows-msvc -verify
// RUN: %clang_cc1 %s -fsyntax-only -triple aarch64-unknown-windows-msvc -verify
// RUN: %clang_cc1 %s -fsyntax-only -triple thumbv7-unknown-windows-msvc -verify
typedef void ;
void
void
= foo;
= foo; // expected-warning {{incompatible function pointer types initializing 'void (*)(void *) __attribute__((cdecl))' with an expression of type 'void (void *) __attribute__((preserve_most))'}}
= foo; // expected-warning {{incompatible function pointer types initializing 'void (*)(void *)' with an expression of type 'void (void *) __attribute__((preserve_most))'}}
typedef_fun_t typedef_fun_foo; // expected-note {{previous declaration is here}}
void // expected-error {{function declared 'preserve_most' here was previously declared without calling convention}}
; // expected-warning {{'preserve_most' attribute only applies to functions and methods}}
void
void
= boo;
= boo; // expected-warning {{incompatible function pointer types initializing 'void (*)(void *) __attribute__((cdecl))' with an expression of type 'void (void *) __attribute__((preserve_all))'}}
= boo; // expected-warning {{incompatible function pointer types initializing 'void (*)(void *)' with an expression of type 'void (void *) __attribute__((preserve_all))'}}
typedef_fun_t typedef_fun_boo; // expected-note {{previous declaration is here}}
void // expected-error {{function declared 'preserve_all' here was previously declared without calling convention}}
; // expected-warning {{'preserve_all' attribute only applies to functions and methods}}