Fix profile test assuming dumb compiler
authorRenato Golin <renato.golin@linaro.org>
Thu, 1 Sep 2016 13:45:47 +0000 (13:45 +0000)
committerRenato Golin <renato.golin@linaro.org>
Thu, 1 Sep 2016 13:45:47 +0000 (13:45 +0000)
Commit r280364 has introduced some call-graph optmisations making a profiler
test "fail" due to not expecting the compiler to be "smart", and fold constants
across functions. This commit works around the issue, leaving the origial
semantics intact.

llvm-svn: 280365

compiler-rt/test/profile/Linux/instrprof-cs.c

index 3be4359..fdf29cb 100644 (file)
@@ -11,7 +11,7 @@
 // Check context insenstive profile
 // RUN: %clang_profuse=%t.cis.profdata  -O2 -emit-llvm -S %s -o - | FileCheck %s --check-prefix=CIS
 int g1 = 1;
-int g2 = 2;
+int volatile g2 = 2;
 static void toggle(int t) {
   if (t & 1)
     g1 *= t;