[mini] Use C++ linker iff building C++ that needs the C++ runtime (#12266)
[mono-project.git] / mono / profiler / test-traces.cs
blobee1d0e1af43f7965059b2297306a8d920a0220de
1 using System;
2 using System.Runtime.CompilerServices;
4 class T {
6 static object o = null;
8 [MethodImpl (MethodImplOptions.NoInlining)]
9 static void level3 (int op) {
10 level2 (op);
13 [MethodImpl (MethodImplOptions.NoInlining)]
14 static void level2 (int op) {
15 level1 (op);
18 [MethodImpl (MethodImplOptions.NoInlining)]
19 static void level1 (int op) {
20 level0 (op);
23 [MethodImpl (MethodImplOptions.NoInlining)]
24 static void level0 (int op) {
25 switch (op) {
26 case 0: o = new T (); break;
27 case 1: throw new Exception (); break;
31 static void Main (string[] args) {
32 int count = 1010;
33 for (int i = 0; i < count; ++i) {
34 level3 (0);
36 for (int i = 0; i < count; ++i) {
37 try {
38 level3 (1);
39 } catch {