add test for #5559 (unicode cost-centre names)
authorSimon Marlow <marlowsd@gmail.com>
Wed, 9 Nov 2011 09:50:13 +0000 (09:50 +0000)
committerSimon Marlow <marlowsd@gmail.com>
Wed, 9 Nov 2011 10:38:54 +0000 (10:38 +0000)
testsuite/tests/profiling/should_run/T5559.hs [new file with mode: 0644]
testsuite/tests/profiling/should_run/T5559.prof.sample [new file with mode: 0644]
testsuite/tests/profiling/should_run/T5559.stdout [new file with mode: 0644]
testsuite/tests/profiling/should_run/all.T

diff --git a/testsuite/tests/profiling/should_run/T5559.hs b/testsuite/tests/profiling/should_run/T5559.hs
new file mode 100644 (file)
index 0000000..e25a40f
--- /dev/null
@@ -0,0 +1,8 @@
+føb :: Integer -> Integer
+føb n
+  | n == 0 = 0
+  | n == 1 = 1
+  | n >= 2 = føb (n - 1) + føb (n - 2)
+
+main :: IO ()
+main = print (føb 26)
diff --git a/testsuite/tests/profiling/should_run/T5559.prof.sample b/testsuite/tests/profiling/should_run/T5559.prof.sample
new file mode 100644 (file)
index 0000000..6bc1740
--- /dev/null
@@ -0,0 +1,23 @@
+       Wed Nov  9 09:45 2011 Time and Allocation Profiling Report  (Final)
+
+          T5559 +RTS -p -RTS
+
+       total time  =        0.08 secs   (4 ticks @ 20 ms)
+       total alloc =  52,274,888 bytes  (excludes profiling overheads)
+
+COST CENTRE MODULE  %time %alloc
+
+føb         Main    100.0   99.9
+
+
+                                                      individual     inherited
+COST CENTRE MODULE                  no.     entries  %time %alloc   %time %alloc
+
+MAIN        MAIN                    100           0    0.0    0.0   100.0  100.0
+ CAF        GHC.IO.Handle.FD        126           0    0.0    0.1     0.0    0.1
+ CAF        GHC.IO.Encoding.Iconv   118           0    0.0    0.0     0.0    0.0
+ CAF        GHC.IO.Encoding         116           0    0.0    0.0     0.0    0.0
+ CAF        GHC.Conc.Signal         108           0    0.0    0.0     0.0    0.0
+ CAF        Main                    106           0    0.0    0.0   100.0   99.9
+  main      Main                    200           1    0.0    0.0   100.0   99.9
+   føb      Main                    201      392835  100.0   99.9   100.0   99.9
diff --git a/testsuite/tests/profiling/should_run/T5559.stdout b/testsuite/tests/profiling/should_run/T5559.stdout
new file mode 100644 (file)
index 0000000..cbe88fb
--- /dev/null
@@ -0,0 +1 @@
+121393
index 0fa53f7..86c3907 100644 (file)
@@ -77,6 +77,11 @@ test('prof-doc-last',
      compile_and_run,
      [''])
 
+test('T5559', # unicode in cost centre names
+     [ req_profiling, extra_ways(['prof']), only_ways(['prof'] + prof_ways) ],
+     compile_and_run,
+     [''])
+
 # Note [consistent stacks]
 #  Certain optimisations can change the stacks we get out of the
 #  profiler.  These flags are necessary (but perhaps not sufficient)