2013-12-04 11:41:15 +08:00
|
|
|
// REQUIRES: powerpc-registered-target
|
2018-08-28 03:53:19 +08:00
|
|
|
// RUN: %clang_cc1 -triple powerpc-unknown-linux-gnu -emit-llvm -o - %s -O2 -disable-llvm-passes | FileCheck %s
|
2011-01-06 16:27:10 +08:00
|
|
|
|
|
|
|
int boolsize = sizeof(_Bool);
|
[CodeGenModule] Assume dso_local for -fpic -fno-semantic-interposition
Summary:
Clang -fpic defaults to -fno-semantic-interposition (GCC -fpic defaults
to -fsemantic-interposition).
Users need to specify -fsemantic-interposition to get semantic
interposition behavior.
Semantic interposition is currently a best-effort feature. There may
still be some cases where it is not handled well.
Reviewers: peter.smith, rnk, serge-sans-paille, sfertile, jfb, jdoerfert
Subscribers: dschuff, jyknight, dylanmckay, nemanjai, jvesely, kbarton, fedor.sergeev, asb, rbar, johnrusso, simoncook, sabuasal, niosHD, jrtc27, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, arphaman, PkmX, jocewei, jsji, Jim, lenary, s.egerton, pzheng, sameer.abuasal, apazos, luismarques, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D73865
2020-02-03 04:23:47 +08:00
|
|
|
// CHECK: boolsize = dso_local global i32 1, align 4
|
2011-01-06 16:27:10 +08:00
|
|
|
|
2012-11-13 10:05:15 +08:00
|
|
|
void f(_Bool *x, _Bool *y) {
|
|
|
|
*x = *y;
|
|
|
|
}
|
|
|
|
|
[CodeGenModule] Assume dso_local for -fpic -fno-semantic-interposition
Summary:
Clang -fpic defaults to -fno-semantic-interposition (GCC -fpic defaults
to -fsemantic-interposition).
Users need to specify -fsemantic-interposition to get semantic
interposition behavior.
Semantic interposition is currently a best-effort feature. There may
still be some cases where it is not handled well.
Reviewers: peter.smith, rnk, serge-sans-paille, sfertile, jfb, jdoerfert
Subscribers: dschuff, jyknight, dylanmckay, nemanjai, jvesely, kbarton, fedor.sergeev, asb, rbar, johnrusso, simoncook, sabuasal, niosHD, jrtc27, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, arphaman, PkmX, jocewei, jsji, Jim, lenary, s.egerton, pzheng, sameer.abuasal, apazos, luismarques, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D73865
2020-02-03 04:23:47 +08:00
|
|
|
// CHECK-LABEL: define dso_local void @f(
|
2018-08-28 03:53:19 +08:00
|
|
|
// CHECK: [[FROMMEM:%.*]] = load i8, i8* %
|
|
|
|
// CHECK: [[BOOLVAL:%.*]] = trunc i8 [[FROMMEM]] to i1
|
|
|
|
// CHECK: [[TOMEM:%.*]] = zext i1 [[BOOLVAL]] to i8
|
|
|
|
// CHECK: store i8 [[TOMEM]]
|
2012-11-13 10:05:15 +08:00
|
|
|
// CHECK: ret void
|
|
|
|
|
2018-08-28 03:53:19 +08:00
|
|
|
// CHECK: i8 0, i8 2}
|