summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/abi/mangle43.C
diff options
context:
space:
mode:
authorupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
committerupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
commit554fd8c5195424bdbcabf5de30fdc183aba391bd (patch)
tree976dc5ab7fddf506dadce60ae936f43f58787092 /gcc/testsuite/g++.dg/abi/mangle43.C
downloadcbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.bz2
cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.xz
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository.
Diffstat (limited to 'gcc/testsuite/g++.dg/abi/mangle43.C')
-rw-r--r--gcc/testsuite/g++.dg/abi/mangle43.C43
1 files changed, 43 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/abi/mangle43.C b/gcc/testsuite/g++.dg/abi/mangle43.C
new file mode 100644
index 000000000..4dfa425f6
--- /dev/null
+++ b/gcc/testsuite/g++.dg/abi/mangle43.C
@@ -0,0 +1,43 @@
+// { dg-do compile { target int128 } }
+// { dg-options "" }
+
+struct S {
+ S(void) { m_i128 = 0; m_u128 = 0; }
+ ~S(void) { }
+ __int128 get1 (void) { return m_i128; }
+ unsigned __int128 get2 (void) { return m_u128; }
+ void set1 (__int128 i) { m_i128 = i; }
+ void set2 (unsigned int i) { m_u128 = 1; }
+ __int128 m_i128;
+ unsigned __int128 m_u128;
+};
+
+struct S glb;
+
+__int128 fo1 (void) { return glb.get1 (); }
+unsigned __int128 fo2 (void) { return glb.get2 (); }
+__int128 fo3 (__int128 i) { __int128 v = fo1 (); glb.set1 (i); return v; }
+unsigned __int128 fo4 (unsigned __int128 i)
+{
+ unsigned __int128 v = fo2 (); glb.set2 (i);
+ return v;
+}
+
+__int128 fo5 (__int128 i)
+{
+ return fo3 (i);
+}
+
+__int128 fo5 (unsigned __int128 i)
+{
+ return (__int128) fo4 (i);
+}
+
+
+// { dg-final { scan-assembler "\n_?_Z3fo1v\[: \t\n\]" } }
+// { dg-final { scan-assembler "\n_?_Z3fo2v\[: \t\n\]" } }
+// { dg-final { scan-assembler "\n_?_Z3fo3n\[: \t\n\]" } }
+// { dg-final { scan-assembler "\n_?_Z3fo4o\[: \t\n\]" } }
+// { dg-final { scan-assembler "\n_?_Z3fo5n\[: \t\n\]" } }
+// { dg-final { scan-assembler "\n_?_Z3fo5o\[: \t\n\]" } }
+