Files
clang-p2996/clang/test/CodeGen/available-externally-hidden.cpp
Teresa Johnson 8749d80431 Resubmit "Pass down the -flto option to the -cc1 job" (r239481)
The patch is the same except for the addition of a new test for the
issue that required reverting the dependent llvm commit.

--Original Commit Message--

Pass down the -flto option to the -cc1 job, and from there into the
CodeGenOptions and onto the PassManagerBuilder. This enables gating
the new EliminateAvailableExternally module pass on whether we are
preparing for LTO.

If we are preparing for LTO (e.g. a -flto -c compile), the new pass is not
included as we want to preserve available externally functions for possible
link time inlining.

llvm-svn: 241467
2015-07-06 16:23:00 +00:00

33 lines
813 B
C++

// RUN: %clang_cc1 -O2 -fvisibility hidden -std=c++11 -emit-llvm -o - -triple x86_64-apple-darwin10 %s | FileCheck %s
// Ensure that available_externally functions eliminated at -O2 are now
// declarations, and are not emitted as hidden with -fvisibility=hidden,
// but rather with default visibility.
struct Filter {
virtual void Foo();
int a;
};
class Message{};
class Sender {
public:
virtual bool Send(Message* msg) = 0;
protected:
virtual ~Sender() {}
};
// CHECK: declare zeroext i1 @_ZThn16_N17SyncMessageFilter4SendEP7Message
class SyncMessageFilter : public Filter, public Sender {
public:
bool Send(Message* message) override;
};
class TestSyncMessageFilter : public SyncMessageFilter {
};
int main() {
TestSyncMessageFilter* f = new TestSyncMessageFilter;
f->Send(new Message);
}