summaryrefslogtreecommitdiffstats
path: root/test/FixIt/fixit-unicode.c
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2012-08-15 20:02:54 +0000
committerdim <dim@FreeBSD.org>2012-08-15 20:02:54 +0000
commit554bcb69c2d785a011a30e7db87a36a87fe7db10 (patch)
tree9abb1a658a297776086f4e0dfa6ca533de02104e /test/FixIt/fixit-unicode.c
parentbb67ca86b31f67faee50bd10c3b036d65751745a (diff)
downloadFreeBSD-src-554bcb69c2d785a011a30e7db87a36a87fe7db10.zip
FreeBSD-src-554bcb69c2d785a011a30e7db87a36a87fe7db10.tar.gz
Vendor import of clang trunk r161861:
http://llvm.org/svn/llvm-project/cfe/trunk@161861
Diffstat (limited to 'test/FixIt/fixit-unicode.c')
-rw-r--r--test/FixIt/fixit-unicode.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/test/FixIt/fixit-unicode.c b/test/FixIt/fixit-unicode.c
new file mode 100644
index 0000000..2af5e08
--- /dev/null
+++ b/test/FixIt/fixit-unicode.c
@@ -0,0 +1,33 @@
+// RUN: %clang_cc1 -fsyntax-only %s 2>&1 | FileCheck -strict-whitespace %s
+// RUN: %clang_cc1 -fsyntax-only -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck -check-prefix=CHECK-MACHINE %s
+
+struct Foo {
+ int bar;
+};
+
+// PR13312
+void test1() {
+ struct Foo foo;
+ (&foo)☃>bar = 42;
+// CHECK: error: expected ';' after expression
+// Make sure we emit the fixit right in front of the snowman.
+// CHECK: {{^ \^}}
+// CHECK: {{^ ;}}
+
+// CHECK-MACHINE: fix-it:"{{.*}}fixit-unicode.c":{11:9-11:9}:";"
+}
+
+
+int printf(const char *, ...);
+void test2() {
+ printf("∆: %d", 1L);
+// CHECK: warning: format specifies type 'int' but the argument has type 'long'
+// Don't crash emitting a fixit after the delta.
+// CHECK: printf("
+// CHECK: : %d", 1L);
+// Unfortunately, we can't actually check the location of the printed fixit,
+// because different systems will render the delta differently (either as a
+// character, or as <U+2206>.) The fixit should line up with the %d regardless.
+
+// CHECK-MACHINE: fix-it:"{{.*}}fixit-unicode.c":{23:16-23:18}:"%ld"
+}
OpenPOWER on IntegriCloud