1 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -target-feature +sse2 -fsyntax-only -verify=expected,c %s 2 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -target-feature +sse2 -fsyntax-only -verify=expected,cxx %s -x c++ 3 f(void)4void f(void) { 5 (void)_mm_getcsr(); // cxx-warning{{implicitly declaring library function '_mm_getcsr'}} \ 6 c-error{{call to undeclared library function '_mm_getcsr'}} \ 7 expected-note{{include the header <xmmintrin.h> or explicitly provide a declaration for '_mm_getcsr'}} 8 _mm_setcsr(1); // cxx-warning{{implicitly declaring library function '_mm_setcsr'}} \ 9 c-error{{call to undeclared library function '_mm_setcsr'}} \ 10 expected-note{{include the header <xmmintrin.h> or explicitly provide a declaration for '_mm_setcsr'}} 11 _mm_sfence(); // cxx-warning{{implicitly declaring library function '_mm_sfence'}} \ 12 c-error{{call to undeclared library function '_mm_sfence'}} \ 13 expected-note{{include the header <xmmintrin.h> or explicitly provide a declaration for '_mm_sfence'}} 14 15 _mm_clflush((void*)0); // cxx-warning{{implicitly declaring library function '_mm_clflush'}} \ 16 c-error{{call to undeclared library function '_mm_clflush'}} \ 17 expected-note{{include the header <emmintrin.h> or explicitly provide a declaration for '_mm_clflush'}} 18 _mm_lfence(); // cxx-warning{{implicitly declaring library function '_mm_lfence'}} \ 19 c-error{{call to undeclared library function '_mm_lfence'}} \ 20 expected-note{{include the header <emmintrin.h> or explicitly provide a declaration for '_mm_lfence'}} 21 _mm_mfence(); // cxx-warning{{implicitly declaring library function '_mm_mfence'}} \ 22 c-error{{call to undeclared library function '_mm_mfence'}} \ 23 expected-note{{include the header <emmintrin.h> or explicitly provide a declaration for '_mm_mfence'}} 24 _mm_pause(); // cxx-warning{{implicitly declaring library function '_mm_pause'}} \ 25 c-error{{call to undeclared library function '_mm_pause'}} \ 26 expected-note{{include the header <emmintrin.h> or explicitly provide a declaration for '_mm_pause'}} 27 } 28 29 unsigned int _mm_getcsr(void); 30 void _mm_setcsr(unsigned int); 31 void _mm_sfence(void); 32 33 void _mm_clflush(void const *); 34 void _mm_lfence(void); 35 void _mm_mfence(void); 36 void _mm_pause(void); 37 g(void)38void g(void) { 39 (void)_mm_getcsr(); 40 _mm_setcsr(1); 41 _mm_sfence(); 42 43 _mm_clflush((void*)0); 44 _mm_lfence(); 45 _mm_mfence(); 46 _mm_pause(); 47 } 48