Rafael Espindola 922f2aa9b2 Bring r325915 back.
The tests that failed on a windows host have been fixed.

Original message:

Start setting dso_local for COFF.

With this there are still some GVs where we don't set dso_local
because setGVProperties is never called. I intend to fix that in
followup commits. This is just the bare minimum to teach
shouldAssumeDSOLocal what it should do for COFF.

llvm-svn: 325940
2018-02-23 19:30:48 +00:00

17 lines
553 B
C++

// RUN: %clang_cc1 -emit-llvm -triple=i386-pc-win32 %s -o - | FileCheck %s
struct A {};
struct B : A {};
extern "C" {
extern int B::*a;
void test1() { (int A::*)(a); }
}
// CHECK-LABEL: define dso_local void @test1(
// CHECK: %[[load:.*]] = load i32, i32* @a
// CHECK: %[[memptr_cmp:.*]] = icmp ne i32 %[[load]], -1
// CHECK: br i1 %[[memptr_cmp]]
// CHECK: %[[adj:.*]] = sub nsw i32 %[[load]], 0
// CHECK: %[[nv_adj:.*]] = select i1 true, i32 %[[adj]], i32 0
// CHECK: %[[memptr_converted:.*]] = phi i32 [ -1, {{.*}} ], [ %[[nv_adj]], {{.*}} ]