llvm-project/clang/test/CodeGen/builtins-ppc-p7.c
Fangrui Song fd739804e0 [test] Add {{.*}} to make ELF tests immune to dso_local/dso_preemptable/(none) differences
For a default visibility external linkage definition, dso_local is set for ELF
-fno-pic/-fpie and COFF and Mach-O. Since default clang -cc1 for ELF is similar
to -fpic ("PIC Level" is not set), this nuance causes unneeded binary format differences.

To make emitted IR similar, ELF -cc1 -fpic will default to -fno-semantic-interposition,
which sets dso_local for default visibility external linkage definitions.

To make this flip smooth and enable future (dso_local as definition default),
this patch replaces (function) `define ` with `define{{.*}} `,
(variable/constant/alias) `= ` with `={{.*}} `, or inserts appropriate `{{.*}} `.
2020-12-31 00:27:11 -08:00

53 lines
1.2 KiB
C

// REQUIRES: powerpc-registered-target
// RUN: %clang_cc1 -triple powerpc64-unknown-unknown -target-cpu pwr7 \
// RUN: -emit-llvm %s -o - | FileCheck %s
// RUN: %clang_cc1 -triple powerpc64le-unknown-unknown -target-cpu pwr8 \
// RUN: -emit-llvm %s -o - | FileCheck %s
// CHECK-LABEL: define{{.*}} signext i32 @test_divwe
int test_divwe(void)
{
int a = 74;
int b = 32;
return __builtin_divwe(a, b);
// CHECK: @llvm.ppc.divwe
}
// CHECK-LABEL: define{{.*}} zeroext i32 @test_divweu
unsigned int test_divweu(void)
{
unsigned int a = 74;
unsigned int b = 32;
return __builtin_divweu(a, b);
// CHECK: @llvm.ppc.divweu
}
// CHECK-LABEL: define{{.*}} i64 @test_divde
long long test_divde(void)
{
long long a = 74LL;
long long b = 32LL;
return __builtin_divde(a, b);
// CHECK: @llvm.ppc.divde
}
// CHECK-LABEL: define{{.*}} i64 @test_divdeu
unsigned long long test_divdeu(void)
{
unsigned long long a = 74ULL;
unsigned long long b = 32ULL;
return __builtin_divdeu(a, b);
// CHECK: @llvm.ppc.divdeu
}
// CHECK-LABEL: define{{.*}} i64 @test_bpermd
long long test_bpermd(void)
{
long long a = 74LL;
long long b = 32LL;
return __builtin_bpermd(a, b);
// CHECK: @llvm.ppc.bpermd
}