[Mips] Support -mmicromips / -mno-micromips command line options.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179489 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Driver/mips-features.c b/test/Driver/mips-features.c
index 3bebffc..3f4730b 100644
--- a/test/Driver/mips-features.c
+++ b/test/Driver/mips-features.c
@@ -14,6 +14,18 @@
 // RUN:   | FileCheck --check-prefix=CHECK-NOMIPS16 %s
 // CHECK-NOMIPS16: "-target-feature" "-mips16"
 //
+// -mmicromips
+// RUN: %clang -target mips-linux-gnu -### -c %s \
+// RUN:     -mno-micromips -mmicromips 2>&1 \
+// RUN:   | FileCheck --check-prefix=CHECK-MICROMIPS %s
+// CHECK-MICROMIPS: "-target-feature" "+micromips"
+//
+// -mno-micromips
+// RUN: %clang -target mips-linux-gnu -### -c %s \
+// RUN:     -mmicromips -mno-micromips 2>&1 \
+// RUN:   | FileCheck --check-prefix=CHECK-NOMICROMIPS %s
+// CHECK-NOMICROMIPS: "-target-feature" "-micromips"
+//
 // -mdsp
 // RUN: %clang -target mips-linux-gnu -### -c %s \
 // RUN:     -mno-dsp -mdsp 2>&1 \
diff --git a/test/Preprocessor/init.c b/test/Preprocessor/init.c
index 8ab1439..c1519a8 100644
--- a/test/Preprocessor/init.c
+++ b/test/Preprocessor/init.c
@@ -1168,6 +1168,16 @@
 // RUN:   | FileCheck -check-prefix NOMIPS16 %s
 // NOMIPS16-NOT:#define __mips16 1
 //
+// RUN: %clang_cc1 -target-feature +micromips \
+// RUN:   -E -dM -triple=mips-none-none < /dev/null \
+// RUN:   | FileCheck -check-prefix MICROMIPS %s
+// MICROMIPS:#define __mips_micromips 1
+//
+// RUN: %clang_cc1 -target-feature -micromips \
+// RUN:   -E -dM -triple=mips-none-none < /dev/null \
+// RUN:   | FileCheck -check-prefix NOMICROMIPS %s
+// NOMICROMIPS-NOT:#define __mips_micromips 1
+//
 // RUN: %clang_cc1 -target-feature +dsp \
 // RUN:   -E -dM -triple=mips-none-none < /dev/null \
 // RUN:   | FileCheck -check-prefix MIPS-DSP %s