summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/torture/pr45874.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/torture/pr45874.C
downloadcbb-gcc-4.6.4-upstream.tar.bz2
cbb-gcc-4.6.4-upstream.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/torture/pr45874.C')
-rw-r--r--gcc/testsuite/g++.dg/torture/pr45874.C58
1 files changed, 58 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/torture/pr45874.C b/gcc/testsuite/g++.dg/torture/pr45874.C
new file mode 100644
index 000000000..70965ff57
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/pr45874.C
@@ -0,0 +1,58 @@
+// { dg-do compile }
+
+typedef struct {
+} IppLibraryVersion;
+typedef unsigned char Ipp8u;
+typedef unsigned int Ipp32u;
+typedef signed int Ipp32s;
+typedef enum e_vm_Status {
+ VM_OK = 0, VM_OPERATION_FAILED =-999, VM_NOT_INITIALIZED =-998, VM_TIMEOUT =-987, VM_NOT_ENOUGH_DATA =-996, VM_NULL_PTR =-995, VM_SO_CANT_LOAD =-994, VM_SO_INVALID_HANDLE =-993, VM_SO_CANT_GET_ADDR =-992 }
+ vm_status;
+ typedef Ipp32s Status;
+ class MediaReceiver {
+ };
+class MediaBuffer : public MediaReceiver {
+};
+struct TrackInfo {
+};
+struct Mpeg2TrackInfo : public TrackInfo {
+};
+class BitstreamReader {
+public: BitstreamReader(void);
+ virtual ~BitstreamReader(void) {
+ }
+ Ipp32u GetBits(Ipp32s iNum);
+ void SkipBits(Ipp32s iNum);
+protected: virtual void Refresh(void);
+ Ipp32s m_iReadyBits;
+};
+class FrameConstructor : public MediaBuffer {
+};
+class VideoFrameConstructor : public FrameConstructor {
+};
+class Mpeg2FrameConstructor : public VideoFrameConstructor {
+ static Status ParsePictureHeader(Ipp8u *buf, Ipp32s iLen, Mpeg2TrackInfo *pInfo);
+};
+Status Mpeg2FrameConstructor::ParsePictureHeader(Ipp8u *buf, Ipp32s iLen, Mpeg2TrackInfo *pInfo) {
+ BitstreamReader bs;
+ bs.SkipBits(32 + 4 + 4 + 4 + 4 + 4 + 2);
+ bs.SkipBits(1 + 1 + 1 + 1 + 1 + 1 + 1);
+ bs.SkipBits(5);
+ bs.SkipBits(3);
+ Ipp8u source_format;
+ bs.SkipBits(22);
+ bs.SkipBits(8);
+ if (7 == source_format) {
+ Ipp8u ufep = (Ipp8u)bs.GetBits(3);
+ if (0x01 == ufep) {
+ bs.SkipBits(10);
+ }
+ }
+}
+void BitstreamReader::SkipBits(Ipp32s iNum) {
+ if (iNum <= m_iReadyBits) {
+ m_iReadyBits -= iNum;
+ Refresh();
+ }
+}
+void BitstreamReader::Refresh(void) { }