summaryrefslogtreecommitdiffstats
path: root/test/Lexer
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2010-09-17 15:54:40 +0000
committerdim <dim@FreeBSD.org>2010-09-17 15:54:40 +0000
commit36c49e3f258dced101949edabd72e9bc3f1dedc4 (patch)
tree0bbe07708f7571f8b5291f6d7b96c102b7c99dee /test/Lexer
parentfc84956ac8b7cd244ef30e7a4d4d38a58dec5904 (diff)
downloadFreeBSD-src-36c49e3f258dced101949edabd72e9bc3f1dedc4.zip
FreeBSD-src-36c49e3f258dced101949edabd72e9bc3f1dedc4.tar.gz
Vendor import of clang r114020 (from the release_28 branch):
http://llvm.org/svn/llvm-project/cfe/branches/release_28@114020 Approved by: rpaulo (mentor)
Diffstat (limited to 'test/Lexer')
-rw-r--r--test/Lexer/c90.c16
-rw-r--r--test/Lexer/constants.c3
-rw-r--r--test/Lexer/has_feature_cxx0x.cpp10
-rw-r--r--test/Lexer/ms-extensions.c (renamed from test/Lexer/constants-ms.c)16
-rw-r--r--test/Lexer/preamble.c37
5 files changed, 82 insertions, 0 deletions
diff --git a/test/Lexer/c90.c b/test/Lexer/c90.c
index 6293d42..f191397 100644
--- a/test/Lexer/c90.c
+++ b/test/Lexer/c90.c
@@ -11,3 +11,19 @@ b;}
// comment accepted as extension /* expected-error {{// comments are not allowed in this language}}
+void test2() {
+ const char * str =
+ "sdjflksdjf lksdjf skldfjsdkljflksdjf kldsjflkdsj fldks jflsdkjfds" // expected-error{{string literal of length 845 exceeds maximum length 509 that C90 compilers are required to support}}
+ "sdjflksdjf lksdjf skldfjsdkljflksdjf kldsjflkdsj fldks jflsdkjfds"
+ "sdjflksdjf lksdjf skldfjsdkljflksdjf kldsjflkdsj fldks jflsdkjfds"
+ "sdjflksdjf lksdjf skldfjsdkljflksdjf kldsjflkdsj fldks jflsdkjfds"
+ "sdjflksdjf lksdjf skldfjsdkljflksdjf kldsjflkdsj fldks jflsdkjfds"
+ "sdjflksdjf lksdjf skldfjsdkljflksdjf kldsjflkdsj fldks jflsdkjfds"
+ "sdjflksdjf lksdjf skldfjsdkljflksdjf kldsjflkdsj fldks jflsdkjfds"
+ "sdjflksdjf lksdjf skldfjsdkljflksdjf kldsjflkdsj fldks jflsdkjfds"
+ "sdjflksdjf lksdjf skldfjsdkljflksdjf kldsjflkdsj fldks jflsdkjfds"
+ "sdjflksdjf lksdjf skldfjsdkljflksdjf kldsjflkdsj fldks jflsdkjfds"
+ "sdjflksdjf lksdjf skldfjsdkljflksdjf kldsjflkdsj fldks jflsdkjfds"
+ "sdjflksdjf lksdjf skldfjsdkljflksdjf kldsjflkdsj fldks jflsdkjfds"
+ "sdjflksdjf lksdjf skldfjsdkljflksdjf kldsjflkdsj fldks jflsdkjfds";
+}
diff --git a/test/Lexer/constants.c b/test/Lexer/constants.c
index 2602ec2..de0962e 100644
--- a/test/Lexer/constants.c
+++ b/test/Lexer/constants.c
@@ -62,3 +62,6 @@ double t1[] = {
-1.9e500, // expected-warning {{too large}}
-1.9e-500 // expected-warning {{too small}}
};
+
+// PR7888
+double g = 1e100000000; // expected-warning {{too large}}
diff --git a/test/Lexer/has_feature_cxx0x.cpp b/test/Lexer/has_feature_cxx0x.cpp
index 650e577..cc2ae28 100644
--- a/test/Lexer/has_feature_cxx0x.cpp
+++ b/test/Lexer/has_feature_cxx0x.cpp
@@ -99,3 +99,13 @@ int no_variadic_templates();
// CHECK-0X: no_variadic_templates
// CHECK-NO-0X: no_variadic_templates
+
+
+#if __has_feature(cxx_inline_namespaces)
+int inline_namespaces();
+#else
+int no_inline_namespaces();
+#endif
+
+// CHECK-0X: inline_namespaces
+// CHECK-NO-0X: inline_namespaces
diff --git a/test/Lexer/constants-ms.c b/test/Lexer/ms-extensions.c
index 97e6600..8b7d2e1 100644
--- a/test/Lexer/constants-ms.c
+++ b/test/Lexer/ms-extensions.c
@@ -23,3 +23,19 @@ void a() {
unsigned short s = USHORT;
unsigned char c = UCHAR;
}
+
+void pr_7968()
+{
+ int var1 = 0x1111111e+1;
+ int var2 = 0X1111111e+1;
+ int var3 = 0xe+1;
+ int var4 = 0XE+1;
+
+ int var5= 0\
+x1234e+1;
+
+ int var6=
+ /*expected-warning {{backslash and newline separated by space}} */ 0\
+x1234e+1;
+}
+
diff --git a/test/Lexer/preamble.c b/test/Lexer/preamble.c
new file mode 100644
index 0000000..69cdbb7
--- /dev/null
+++ b/test/Lexer/preamble.c
@@ -0,0 +1,37 @@
+// Preamble detection test: see below for comments and test commands.
+//
+#include <blah>
+#ifndef FOO
+#else
+#ifdef BAR
+#elif WIBBLE
+#endif
+#pragma unknown
+#endif
+#ifdef WIBBLE
+#include "honk"
+#else
+int foo();
+#endif
+
+// This test checks for detection of the preamble of a file, which
+// includes all of the starting comments and #includes. Note that any
+// changes to the preamble part of this file must be mirrored in
+// Inputs/preamble.txt, since we diff against it.
+
+// RUN: %clang_cc1 -print-preamble %s > %t
+// RUN: echo END. >> %t
+// RUN: FileCheck < %t %s
+// XFAIL: win32
+
+// CHECK: // Preamble detection test: see below for comments and test commands.
+// CHECK-NEXT: //
+// CHECK-NEXT: #include <blah>
+// CHECK-NEXT: #ifndef FOO
+// CHECK-NEXT: #else
+// CHECK-NEXT: #ifdef BAR
+// CHECK-NEXT: #elif WIBBLE
+// CHECK-NEXT: #endif
+// CHECK-NEXT: #pragma unknown
+// CHECK-NEXT: #endif
+// CHECK-NEXT: END.
OpenPOWER on IntegriCloud