MIPS: Define __mips16 macro if -mips16 option is provided.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159753 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Preprocessor/init.c b/test/Preprocessor/init.c
index 9694aad..29ad682 100644
--- a/test/Preprocessor/init.c
+++ b/test/Preprocessor/init.c
@@ -876,6 +876,18 @@
 // MIPS-FABI-SINGLE:#define __mips_hard_float 1
 // MIPS-FABI-SINGLE:#define __mips_single_float 1
 //
+// Check MIPS features macros
+//
+// RUN: %clang_cc1 -target-feature +mips16 \
+// RUN:   -E -dM -triple=mips-none-none < /dev/null \
+// RUN:   | FileCheck -check-prefix MIPS16 %s
+// MIPS16:#define __mips16 1
+//
+// RUN: %clang_cc1 -target-feature -mips16 \
+// RUN:   -E -dM -triple=mips-none-none < /dev/null \
+// RUN:   | FileCheck -check-prefix NOMIPS16 %s
+// NOMIPS16-NOT:#define __mips16 1
+//
 // RUN: %clang_cc1 -E -dM -ffreestanding -triple=msp430-none-none < /dev/null | FileCheck -check-prefix MSP430 %s
 //
 // MSP430:#define MSP430 1