summaryrefslogtreecommitdiff
path: root/gcc_arm/testsuite/g++.old-deja/g++.pt/explicit53.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc_arm/testsuite/g++.old-deja/g++.pt/explicit53.C')
-rwxr-xr-xgcc_arm/testsuite/g++.old-deja/g++.pt/explicit53.C21
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc_arm/testsuite/g++.old-deja/g++.pt/explicit53.C b/gcc_arm/testsuite/g++.old-deja/g++.pt/explicit53.C
new file mode 100755
index 0000000..e66cca9
--- /dev/null
+++ b/gcc_arm/testsuite/g++.old-deja/g++.pt/explicit53.C
@@ -0,0 +1,21 @@
+extern "C" void abort ();
+
+template <int a> inline int fact ();
+template <> inline int fact<1> ();
+
+template <int a> inline int fact ()
+{
+ return a * fact<a-1> ();
+}
+
+template <> inline int fact<1> ()
+{
+ return 1;
+}
+
+int main()
+{
+ if (fact<3> () != 6 || fact<1> () != 1
+ || fact<3> () != 6 || fact<1> () != 1 || fact<1+0> () != 1)
+ abort ();
+}