Index: snapshot/mac/mach_o_image_annotations_reader_test_module_crashy_initializer.cc |
diff --git a/snapshot/mac/mach_o_image_annotations_reader_test_module_crashy_initializer.cc b/snapshot/mac/mach_o_image_annotations_reader_test_module_crashy_initializer.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..2ba9bee043af4a606c8d6c90bb8a2b73b5867edb |
--- /dev/null |
+++ b/snapshot/mac/mach_o_image_annotations_reader_test_module_crashy_initializer.cc |
@@ -0,0 +1,31 @@ |
+// Copyright 2015 The Crashpad Authors. All rights reserved. |
+// |
+// Licensed under the Apache License, Version 2.0 (the "License"); |
+// you may not use this file except in compliance with the License. |
+// You may obtain a copy of the License at |
+// |
+// http://www.apache.org/licenses/LICENSE-2.0 |
+// |
+// Unless required by applicable law or agreed to in writing, software |
+// distributed under the License is distributed on an "AS IS" BASIS, |
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
+// See the License for the specific language governing permissions and |
+// limitations under the License. |
+ |
+namespace crashpad { |
+namespace test { |
+namespace { |
+ |
+class CrashyClass { |
+ public: |
+ CrashyClass() { |
+ __builtin_trap(); |
+ } |
+}; |
+ |
+// __attribute__((used)) keeps the dead code stripper away. |
+__attribute__((used)) CrashyClass g_crashy_object; |
+ |
+} // namespace |
+} // namespace test |
+} // namespace crashpad |