summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test
diff options
context:
space:
mode:
authorJustin Bogner <mail@justinbogner.com>2014-11-18 23:03:14 +0000
committerJustin Bogner <mail@justinbogner.com>2014-11-18 23:03:14 +0000
commitaa5bb91f5aefce4b9692a4925a23d3c738cecfb8 (patch)
tree21bd9eee12e99c1b3eb8d57a5d6fa7c4f67608a6 /compiler-rt/test
parenta4884fdefd11f010035ee33f7b694b5202604328 (diff)
downloadbcm5719-llvm-aa5bb91f5aefce4b9692a4925a23d3c738cecfb8.tar.gz
bcm5719-llvm-aa5bb91f5aefce4b9692a4925a23d3c738cecfb8.zip
profile: Robustify instrprof tests
Change these tests not to rely on the exact metadata numbers the profile data gets. llvm-svn: 222279
Diffstat (limited to 'compiler-rt/test')
-rw-r--r--compiler-rt/test/profile/instrprof-basic.c10
-rw-r--r--compiler-rt/test/profile/instrprof-set-filename.c4
-rw-r--r--compiler-rt/test/profile/instrprof-without-libc.c4
-rw-r--r--compiler-rt/test/profile/instrprof-write-file-atexit-explicitly.c4
-rw-r--r--compiler-rt/test/profile/instrprof-write-file-only.c4
-rw-r--r--compiler-rt/test/profile/instrprof-write-file.c8
6 files changed, 17 insertions, 17 deletions
diff --git a/compiler-rt/test/profile/instrprof-basic.c b/compiler-rt/test/profile/instrprof-basic.c
index 2356fb73ba3..fd3516cfad0 100644
--- a/compiler-rt/test/profile/instrprof-basic.c
+++ b/compiler-rt/test/profile/instrprof-basic.c
@@ -4,14 +4,14 @@
// RUN: %clang_profuse=%t.profdata -o - -S -emit-llvm %s | FileCheck %s
int begin(int i) {
- // CHECK: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof !1
+ // CHECK: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof ![[PD1:[0-9]+]]
if (i)
return 0;
return 1;
}
int end(int i) {
- // CHECK: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof !2
+ // CHECK: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof ![[PD2:[0-9]+]]
if (i)
return 0;
return 1;
@@ -21,11 +21,11 @@ int main(int argc, const char *argv[]) {
begin(0);
end(1);
- // CHECK: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof !2
+ // CHECK: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof ![[PD2:[0-9]+]]
if (argc)
return 0;
return 1;
}
-// CHECK: !1 = metadata !{metadata !"branch_weights", i32 1, i32 2}
-// CHECK: !2 = metadata !{metadata !"branch_weights", i32 2, i32 1}
+// CHECK: ![[PD1]] = metadata !{metadata !"branch_weights", i32 1, i32 2}
+// CHECK: ![[PD2]] = metadata !{metadata !"branch_weights", i32 2, i32 1}
diff --git a/compiler-rt/test/profile/instrprof-set-filename.c b/compiler-rt/test/profile/instrprof-set-filename.c
index 51de14f61d6..045821899e4 100644
--- a/compiler-rt/test/profile/instrprof-set-filename.c
+++ b/compiler-rt/test/profile/instrprof-set-filename.c
@@ -5,10 +5,10 @@
void __llvm_profile_set_filename(const char *);
int main(int argc, const char *argv[]) {
- // CHECK: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof !1
+ // CHECK: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof ![[PD1:[0-9]+]]
if (argc < 2)
return 1;
__llvm_profile_set_filename(argv[1]);
return 0;
}
-// CHECK: !1 = metadata !{metadata !"branch_weights", i32 1, i32 2}
+// CHECK: ![[PD1]] = metadata !{metadata !"branch_weights", i32 1, i32 2}
diff --git a/compiler-rt/test/profile/instrprof-without-libc.c b/compiler-rt/test/profile/instrprof-without-libc.c
index 7210001e140..60ca9496c61 100644
--- a/compiler-rt/test/profile/instrprof-without-libc.c
+++ b/compiler-rt/test/profile/instrprof-without-libc.c
@@ -18,7 +18,7 @@ int __llvm_profile_write_buffer(char *);
int write_buffer(uint64_t, const char *);
int main(int argc, const char *argv[]) {
// CHECK-LABEL: define {{.*}} @main(
- // CHECK: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof !1
+ // CHECK: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof ![[PD1:[0-9]+]]
if (argc < 2)
return 1;
@@ -46,7 +46,7 @@ int main(int argc, const char *argv[]) {
return fclose(File);
#endif
}
-// CHECK: !1 = metadata !{metadata !"branch_weights", i32 1, i32 2}
+// CHECK: ![[PD1]] = metadata !{metadata !"branch_weights", i32 1, i32 2}
// CHECK-SYMBOLS-NOT: ___cxx_global_var_init
// CHECK-SYMBOLS-NOT: ___llvm_profile_register_write_file_atexit
diff --git a/compiler-rt/test/profile/instrprof-write-file-atexit-explicitly.c b/compiler-rt/test/profile/instrprof-write-file-atexit-explicitly.c
index 931a48b248c..ba229b9144f 100644
--- a/compiler-rt/test/profile/instrprof-write-file-atexit-explicitly.c
+++ b/compiler-rt/test/profile/instrprof-write-file-atexit-explicitly.c
@@ -8,10 +8,10 @@ int __llvm_profile_register_write_file_atexit(void);
void __llvm_profile_set_filename(const char *);
int main(int argc, const char *argv[]) {
__llvm_profile_register_write_file_atexit();
- // CHECK: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof !1
+ // CHECK: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof ![[PD1:[0-9]+]]
if (argc < 2)
return 1;
__llvm_profile_set_filename(argv[1]);
return 0;
}
-// CHECK: !1 = metadata !{metadata !"branch_weights", i32 1, i32 2}
+// CHECK: ![[PD1]] = metadata !{metadata !"branch_weights", i32 1, i32 2}
diff --git a/compiler-rt/test/profile/instrprof-write-file-only.c b/compiler-rt/test/profile/instrprof-write-file-only.c
index da9d036ec3a..0dd61de39f1 100644
--- a/compiler-rt/test/profile/instrprof-write-file-only.c
+++ b/compiler-rt/test/profile/instrprof-write-file-only.c
@@ -10,7 +10,7 @@ void __llvm_profile_set_filename(const char *);
int foo(int);
int main(int argc, const char *argv[]) {
// CHECK-LABEL: define {{.*}} @main(
- // CHECK: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof !1
+ // CHECK: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof ![[PD1:[0-9]+]]
if (argc > 1)
return 1;
@@ -32,4 +32,4 @@ int foo(int X) {
// CHECK: br i1 %{{.*}}, label %{{.*}}, label %{{[^,]+$}}
return X <= 0 ? -X : X;
}
-// CHECK: !1 = metadata !{metadata !"branch_weights", i32 1, i32 2}
+// CHECK: ![[PD1]] = metadata !{metadata !"branch_weights", i32 1, i32 2}
diff --git a/compiler-rt/test/profile/instrprof-write-file.c b/compiler-rt/test/profile/instrprof-write-file.c
index b950ed0820d..12967cb94a5 100644
--- a/compiler-rt/test/profile/instrprof-write-file.c
+++ b/compiler-rt/test/profile/instrprof-write-file.c
@@ -10,7 +10,7 @@ void __llvm_profile_set_filename(const char *);
int foo(int);
int main(int argc, const char *argv[]) {
// CHECK-LABEL: define {{.*}} @main(
- // CHECK: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof !1
+ // CHECK: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof ![[PD1:[0-9]+]]
if (argc < 2)
return 1;
@@ -27,8 +27,8 @@ int main(int argc, const char *argv[]) {
int foo(int X) {
// CHECK-LABEL: define {{.*}} @foo(
// CHECK1: br i1 %{{.*}}, label %{{.*}}, label %{{[^,]+$}}
- // CHECK2: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof !2
+ // CHECK2: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof ![[PD2:[0-9]+]]
return X <= 0 ? -X : X;
}
-// CHECK: !1 = metadata !{metadata !"branch_weights", i32 1, i32 2}
-// CHECK2: !2 = metadata !{metadata !"branch_weights", i32 2, i32 1}
+// CHECK: ![[PD1]] = metadata !{metadata !"branch_weights", i32 1, i32 2}
+// CHECK2: ![[PD2]] = metadata !{metadata !"branch_weights", i32 2, i32 1}
OpenPOWER on IntegriCloud