summaryrefslogtreecommitdiffstats
path: root/clang/test/Format/language-detection.cpp
diff options
context:
space:
mode:
authorAlexander Kornienko <alexfh@google.com>2013-11-29 15:19:43 +0000
committerAlexander Kornienko <alexfh@google.com>2013-11-29 15:19:43 +0000
commitcabdd738fc7374c476929a4ef48b8c5a8c38386d (patch)
treed304503e5fd7b17333e171384d685e0323f01b82 /clang/test/Format/language-detection.cpp
parent80469038c0c420f5f8a4cd580b6f9e69e80ab7f2 (diff)
downloadbcm5719-llvm-cabdd738fc7374c476929a4ef48b8c5a8c38386d.tar.gz
bcm5719-llvm-cabdd738fc7374c476929a4ef48b8c5a8c38386d.zip
Added LanguageStandard::LS_JavaScript to gate all JS-specific parsing.
Summary: Use LS_JavaScript for files ending with ".js". Added support for ">>>=" operator. Reviewers: djasper, klimek Reviewed By: djasper CC: cfe-commits, klimek Differential Revision: http://llvm-reviews.chandlerc.com/D2242 llvm-svn: 195961
Diffstat (limited to 'clang/test/Format/language-detection.cpp')
-rw-r--r--clang/test/Format/language-detection.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/test/Format/language-detection.cpp b/clang/test/Format/language-detection.cpp
new file mode 100644
index 00000000000..bec444dc9dd
--- /dev/null
+++ b/clang/test/Format/language-detection.cpp
@@ -0,0 +1,7 @@
+// RUN: grep -Ev "// *[A-Z0-9_]+:" %s > %t.js
+// RUN: grep -Ev "// *[A-Z0-9_]+:" %s > %t.cpp
+// RUN: clang-format -style=llvm %t.js | FileCheck -strict-whitespace -check-prefix=CHECK1 %s
+// RUN: clang-format -style=llvm %t.cpp | FileCheck -strict-whitespace -check-prefix=CHECK2 %s
+// CHECK1: {{^a >>>= b;$}}
+// CHECK2: {{^a >> >= b;$}}
+a >>>= b;
OpenPOWER on IntegriCloud