summaryrefslogtreecommitdiff
path: root/test/CodeGen/wchar-size.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGen/wchar-size.c')
-rw-r--r--test/CodeGen/wchar-size.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/CodeGen/wchar-size.c b/test/CodeGen/wchar-size.c
new file mode 100644
index 000000000000..38da462d98cb
--- /dev/null
+++ b/test/CodeGen/wchar-size.c
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm -o - %s | FileCheck %s -check-prefix=LONG-WCHAR
+// RUN: %clang_cc1 -triple x86_64-unknown-windows-msvc -emit-llvm -o - %s | FileCheck %s -check-prefix=SHORT-WCHAR
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm -o - -fshort-wchar %s | FileCheck %s -check-prefix=SHORT-WCHAR
+// Note: -fno-short-wchar implies the target default is used; so there is no
+// need to test this separately here.
+
+// LONG-WCHAR: !{{[0-9]+}} = !{i32 {{[0-9]+}}, !"wchar_size", i32 4}
+// SHORT-WCHAR: !{{[0-9]+}} = !{i32 {{[0-9]+}}, !"wchar_size", i32 2}