]> granicus.if.org Git - clang/commitdiff
MIPS: Mark arguments of __builtin_mips_wrdsp / __builtin_mips_rddsp as a constant...
authorSimon Atanasyan <satanasyan@mips.com>
Sun, 8 Jul 2012 09:10:14 +0000 (09:10 +0000)
committerSimon Atanasyan <satanasyan@mips.com>
Sun, 8 Jul 2012 09:10:14 +0000 (09:10 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159910 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/BuiltinsMips.def
test/CodeGen/builtins-mips-args.c [new file with mode: 0644]

index 0ddcd6fdf0c9e002988945ec37f3776ae4a9e47e..d647e348dc5274760c69e7ea55cd09862b1b2542 100644 (file)
@@ -107,8 +107,8 @@ BUILTIN(__builtin_mips_extr_r_w, "iLLii", "nc")
 BUILTIN(__builtin_mips_extp, "iLLii", "nc")
 BUILTIN(__builtin_mips_extpdp, "iLLii", "nc")
 
-BUILTIN(__builtin_mips_wrdsp, "vii", "nc")
-BUILTIN(__builtin_mips_rddsp, "ii", "nc")
+BUILTIN(__builtin_mips_wrdsp, "viIi", "nc")
+BUILTIN(__builtin_mips_rddsp, "iIi", "nc")
 BUILTIN(__builtin_mips_insv, "iii", "nc")
 BUILTIN(__builtin_mips_bitrev, "ii", "nc")
 BUILTIN(__builtin_mips_packrl_ph, "V2sV2sV2s", "nc")
diff --git a/test/CodeGen/builtins-mips-args.c b/test/CodeGen/builtins-mips-args.c
new file mode 100644 (file)
index 0000000..7dc7377
--- /dev/null
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 -triple mips-unknown-linux-gnu -fsyntax-only -verify %s
+
+void foo() {
+  // MIPS DSP Rev 1
+
+  int a = 3;
+  __builtin_mips_wrdsp(2052, a);  // expected-error{{argument to '__builtin_mips_wrdsp' must be a constant integer}}
+  __builtin_mips_rddsp(a);        // expected-error{{argument to '__builtin_mips_rddsp' must be a constant integer}}
+}