Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(122)

Side by Side Diff: test/cctest/test-fuzz-a64.cc

Issue 148503002: A64: Synchronize with r15545. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « test/cctest/test-double.cc ('k') | test/cctest/test-hashing.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are met: 3 // modification, are permitted provided that the following conditions are met:
4 // 4 //
5 // * Redistributions of source code must retain the above copyright notice, 5 // * Redistributions of source code must retain the above copyright notice,
6 // this list of conditions and the following disclaimer. 6 // this list of conditions and the following disclaimer.
7 // * Redistributions in binary form must reproduce the above copyright notice, 7 // * Redistributions in binary form must reproduce the above copyright notice,
8 // this list of conditions and the following disclaimer in the documentation 8 // this list of conditions and the following disclaimer in the documentation
9 // and/or other materials provided with the distribution. 9 // and/or other materials provided with the distribution.
10 // * Neither the name of ARM Limited nor the names of its contributors may be 10 // * Neither the name of ARM Limited nor the names of its contributors may be
(...skipping 30 matching lines...) Expand all
41 Decoder decoder; 41 Decoder decoder;
42 Instruction buffer[kInstructionSize]; 42 Instruction buffer[kInstructionSize];
43 43
44 for (int i = 0; i < instruction_count; i++) { 44 for (int i = 0; i < instruction_count; i++) {
45 uint32_t instr = mrand48(); 45 uint32_t instr = mrand48();
46 buffer->SetInstructionBits(instr); 46 buffer->SetInstructionBits(instr);
47 decoder.Decode(buffer); 47 decoder.Decode(buffer);
48 } 48 }
49 } 49 }
50 50
51
51 TEST(FUZZ_disasm) { 52 TEST(FUZZ_disasm) {
52 // Feed noise into the disassembler to check that it doesn't crash. 53 // Feed noise into the disassembler to check that it doesn't crash.
53 // 9 million = ~0.2% of the instruction space. 54 // 9 million = ~0.2% of the instruction space.
54 static const int instruction_count = 9 * 1024 * 1024; 55 static const int instruction_count = 9 * 1024 * 1024;
55 56
56 uint16_t seed[3] = {42, 43, 44}; 57 uint16_t seed[3] = {42, 43, 44};
57 seed48(seed); 58 seed48(seed);
58 59
59 Decoder decoder; 60 Decoder decoder;
60 Disassembler disasm; 61 Disassembler disasm;
61 Instruction buffer[kInstructionSize]; 62 Instruction buffer[kInstructionSize];
62 63
63 decoder.AppendVisitor(&disasm); 64 decoder.AppendVisitor(&disasm);
64 for (int i = 0; i < instruction_count; i++) { 65 for (int i = 0; i < instruction_count; i++) {
65 uint32_t instr = mrand48(); 66 uint32_t instr = mrand48();
66 buffer->SetInstructionBits(instr); 67 buffer->SetInstructionBits(instr);
67 decoder.Decode(buffer); 68 decoder.Decode(buffer);
68 } 69 }
69 } 70 }
OLDNEW
« no previous file with comments | « test/cctest/test-double.cc ('k') | test/cctest/test-hashing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698