From 222e2a7620e6520ffaf4fc4e69d79c18da31542e Mon Sep 17 00:00:00 2001 From: "Zancanaro; Carlo" Date: Mon, 24 Sep 2012 09:58:17 +1000 Subject: Add the clang library to the repo (with some of my changes, too). --- clang/test/Lexer/pragma-message.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 clang/test/Lexer/pragma-message.c (limited to 'clang/test/Lexer/pragma-message.c') diff --git a/clang/test/Lexer/pragma-message.c b/clang/test/Lexer/pragma-message.c new file mode 100644 index 0000000..807edda --- /dev/null +++ b/clang/test/Lexer/pragma-message.c @@ -0,0 +1,14 @@ +/* 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}} -- cgit v1.2.3