mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-29 18:16:06 +00:00

Currently, compiling a program with the `-pg` flag will result in an undefined symbol error for `.mcount`. This revision fixes the call to use `__mcount`, which requires a pointer argument to a pointer-sized object (unique per inserted call) on AIX. This is only a partial fix. This patch should fix the `-pg` flag's behaviour on AIX to work with code you are compiling, but it will not link against standard libraries with `mcount` instrumentation calls. The next step is to add profiled libraries to the linker search paths in the Clang driver for the AIX toolchain when linking with `-pg`. Differential Review: https://reviews.llvm.org/D135384
26 lines
869 B
C
26 lines
869 B
C
// RUN: %clang_cc1 -pg -triple powerpc-ibm-aix7.2.0.0 -S -emit-llvm %s -o - | FileCheck %s
|
|
// RUN: %clang_cc1 -pg -triple powerpc64-ibm-aix7.2.0.0 -S -emit-llvm %s -o - | FileCheck %s -check-prefix=CHECK64
|
|
|
|
void foo() {
|
|
}
|
|
|
|
void bar() {
|
|
foo();
|
|
}
|
|
// CHECK: @[[GLOB0:[0-9]+]] = internal global i32 0
|
|
// CHECK: @[[GLOB1:[0-9]+]] = internal global i32 0
|
|
// CHECK64: @[[GLOB0:[0-9]+]] = internal global i64 0
|
|
// CHECK64: @[[GLOB1:[0-9]+]] = internal global i64 0
|
|
// CHECK-LABEL: @foo(
|
|
// CHECK-NEXT: entry:
|
|
// CHECK-NEXT: call void @__mcount(ptr @[[GLOB0]])
|
|
// CHECK64-LABEL: @foo(
|
|
// CHECK64-NEXT: entry:
|
|
// CHECK64-NEXT: call void @__mcount(ptr @[[GLOB0]])
|
|
// CHECK-LABEL: @bar(
|
|
// CHECK-NEXT: entry:
|
|
// CHECK-NEXT: call void @__mcount(ptr @[[GLOB1]])
|
|
// CHECK64-LABEL: @bar(
|
|
// CHECK64-NEXT: entry:
|
|
// CHECK64-NEXT: call void @__mcount(ptr @[[GLOB1]])
|