blob: b67886fa3302fc1155696e566cfe717ab33b4c79 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
/* Test pragma message directive from
http://msdn.microsoft.com/en-us/library/x7dkzch2.aspx */
// message: Sends a string literal to the standard output without terminating
// the compilation.
// #pragma message(messagestring)
// OR
// #pragma message messagestring
//
// RUN: %clang_cc1 -fsyntax-only -verify -Werror %s
#define STRING2(x) #x
#define STRING(x) STRING2(x)
#pragma message(":O I'm a message! " STRING(__LINE__)) // expected-warning {{:O I'm a message! 13}}
#pragma message ":O gcc accepts this! " STRING(__LINE__) // expected-warning {{:O gcc accepts this! 14}}
#pragma message(invalid) // expected-error {{expected string literal in pragma message}}
|