teak-llvm/clang/test/Preprocessor/pragma_ps4.c
Yunzhong Gao 99efc0361b Adds a warning for unrecognized argument to #pragma comment() on PS4.
PS4 target recognizes the #pragma comment() syntax as in -fms-extensions, but
only handles the case of #pragma comment(lib). This patch adds a warning if any
other arguments are encountered.

This patch also refactors the code in ParsePragma.cpp a little bit to make it
more obvious that some codes are being shared between -fms-extensions and PS4.

llvm-svn: 233015
2015-03-23 20:41:42 +00:00

28 lines
1.5 KiB
C

// RUN: %clang_cc1 %s -triple x86_64-scei-ps4 -fsyntax-only -verify -fms-extensions
// On PS4, issue a diagnostic that pragma comments are ignored except:
// #pragma comment lib
#pragma comment(lib)
#pragma comment(lib,"foo")
__pragma(comment(lib, "bar"))
#pragma comment(linker) // expected-warning {{'#pragma comment linker' ignored}}
#pragma comment(linker,"foo") // expected-warning {{'#pragma comment linker' ignored}}
__pragma(comment(linker, " bar=" "2")) // expected-warning {{'#pragma comment linker' ignored}}
#pragma comment(user) // expected-warning {{'#pragma comment user' ignored}}
#pragma comment(user, "Compiled on " __DATE__ " at " __TIME__ ) // expected-warning {{'#pragma comment user' ignored}}
__pragma(comment(user, "foo")) // expected-warning {{'#pragma comment user' ignored}}
#pragma comment(compiler) // expected-warning {{'#pragma comment compiler' ignored}}
#pragma comment(compiler, "foo") // expected-warning {{'#pragma comment compiler' ignored}}
__pragma(comment(compiler, "foo")) // expected-warning {{'#pragma comment compiler' ignored}}
#pragma comment(exestr) // expected-warning {{'#pragma comment exestr' ignored}}
#pragma comment(exestr, "foo") // expected-warning {{'#pragma comment exestr' ignored}}
__pragma(comment(exestr, "foo")) // expected-warning {{'#pragma comment exestr' ignored}}
#pragma comment(foo) // expected-error {{unknown kind of pragma comment}}
__pragma(comment(foo)) // expected-error {{unknown kind of pragma comment}}