Skip to content

Commit

Permalink
[opaque pointer type] update test cases for explicit pointee types on…
Browse files Browse the repository at this point in the history
… global aliases

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247380 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
dwblaikie committed Sep 11, 2015
1 parent bae284e commit c0de2d0
Show file tree
Hide file tree
Showing 18 changed files with 47 additions and 47 deletions.
16 changes: 8 additions & 8 deletions test/CodeGen/alias.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,31 +21,31 @@ const int wacom_usb_ids[] = {1, 1, 2, 3, 5, 8, 13, 0};
// CHECKASM-DAG: .globl wacom_usb_ids
// CHECKASM-DAG: .size wacom_usb_ids, 32
extern const int __mod_usb_device_table __attribute__ ((alias("wacom_usb_ids")));
// CHECKBASIC-DAG: @__mod_usb_device_table = alias getelementptr inbounds ([8 x i32], [8 x i32]* @wacom_usb_ids, i32 0, i32 0)
// CHECKBASIC-DAG: @__mod_usb_device_table = alias i32, getelementptr inbounds ([8 x i32], [8 x i32]* @wacom_usb_ids, i32 0, i32 0)
// CHECKASM-DAG: .globl __mod_usb_device_table
// CHECKASM-DAG: __mod_usb_device_table = wacom_usb_ids
// CHECKASM-DAG-NOT: .size __mod_usb_device_table

extern int g1;
extern int g1 __attribute((alias("g0")));
// CHECKBASIC-DAG: @g1 = alias i32* @g0
// CHECKBASIC-DAG: @g1 = alias i32, i32* @g0
// CHECKASM-DAG: .globl g1
// CHECKASM-DAG: g1 = g0
// CHECKASM-DAG-NOT: .size g1

extern __thread int __libc_errno __attribute__ ((alias ("TL_WITH_ALIAS")));
// CHECKBASIC-DAG: @__libc_errno = thread_local alias i32* @TL_WITH_ALIAS
// CHECKBASIC-DAG: @__libc_errno = thread_local alias i32, i32* @TL_WITH_ALIAS
// CHECKASM-DAG: .globl __libc_errno
// CHECKASM-DAG: __libc_errno = TL_WITH_ALIAS
// CHECKASM-DAG-NOT: .size __libc_errno

void f0(void) { }
extern void f1(void);
extern void f1(void) __attribute((alias("f0")));
// CHECKBASIC-DAG: @f1 = alias void ()* @f0
// CHECKBASIC-DAG: @test8_foo = weak alias bitcast (void ()* @test8_bar to void (...)*)
// CHECKBASIC-DAG: @test8_zed = alias bitcast (void ()* @test8_bar to void (...)*)
// CHECKBASIC-DAG: @test9_zed = alias void ()* @test9_bar
// CHECKBASIC-DAG: @f1 = alias void (), void ()* @f0
// CHECKBASIC-DAG: @test8_foo = weak alias void (...), bitcast (void ()* @test8_bar to void (...)*)
// CHECKBASIC-DAG: @test8_zed = alias void (...), bitcast (void ()* @test8_bar to void (...)*)
// CHECKBASIC-DAG: @test9_zed = alias void (), void ()* @test9_bar
// CHECKBASIC: define void @f0() [[NUW:#[0-9]+]] {

// Make sure that aliases cause referenced values to be emitted.
Expand All @@ -65,7 +65,7 @@ static int inner(int a) { return 0; }
static int inner_weak(int a) { return 0; }
extern __typeof(inner) inner_a __attribute__((alias("inner")));
static __typeof(inner_weak) inner_weak_a __attribute__((weakref, alias("inner_weak")));
// CHECKCC: @inner_a = alias i32 (i32)* @inner
// CHECKCC: @inner_a = alias i32 (i32), i32 (i32)* @inner
// CHECKCC: define internal arm_aapcs_vfpcc i32 @inner(i32 %a) [[NUW:#[0-9]+]] {

int outer(int a) { return inner(a); }
Expand Down
2 changes: 1 addition & 1 deletion test/CodeGen/attributes.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ int t6 __attribute__((visibility("protected")));
// CHECK: @t12 = global i32 0, section "SECT"
int t12 __attribute__((section("SECT")));

// CHECK: @t9 = weak alias bitcast (void ()* @__t8 to void (...)*)
// CHECK: @t9 = weak alias void (...), bitcast (void ()* @__t8 to void (...)*)
void __t8() {}
void t9() __attribute__((weak, alias("__t8")));

Expand Down
2 changes: 1 addition & 1 deletion test/CodeGen/hidden-alias-to-internal-function.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ static void foo(void) {}
void bar(void) __attribute__((alias("foo")))
__attribute__((visibility("hidden")));

// CHECK: @bar = hidden alias void ()* @foo
// CHECK: @bar = hidden alias void (), void ()* @foo
// CHECK: define internal void @foo()
24 changes: 12 additions & 12 deletions test/CodeGen/pragma-weak.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
// CHECK: @correct_linkage = weak global


// CHECK-DAG: @both = alias void ()* @__both
// CHECK-DAG: @both2 = alias void ()* @__both2
// CHECK-DAG: @weakvar_alias = weak alias i32* @__weakvar_alias
// CHECK-DAG: @foo = weak alias void ()* @__foo
// CHECK-DAG: @foo2 = weak alias void ()* @__foo2
// CHECK-DAG: @stutter = weak alias void ()* @__stutter
// CHECK-DAG: @stutter2 = weak alias void ()* @__stutter2
// CHECK-DAG: @declfirst = weak alias void ()* @__declfirst
// CHECK-DAG: @declfirstattr = weak alias void ()* @__declfirstattr
// CHECK-DAG: @mix2 = weak alias void ()* @__mix2
// CHECK-DAG: @a1 = weak alias void ()* @__a1
// CHECK-DAG: @xxx = weak alias void ()* @__xxx
// CHECK-DAG: @both = alias void (), void ()* @__both
// CHECK-DAG: @both2 = alias void (), void ()* @__both2
// CHECK-DAG: @weakvar_alias = weak alias i32, i32* @__weakvar_alias
// CHECK-DAG: @foo = weak alias void (), void ()* @__foo
// CHECK-DAG: @foo2 = weak alias void (), void ()* @__foo2
// CHECK-DAG: @stutter = weak alias void (), void ()* @__stutter
// CHECK-DAG: @stutter2 = weak alias void (), void ()* @__stutter2
// CHECK-DAG: @declfirst = weak alias void (), void ()* @__declfirst
// CHECK-DAG: @declfirstattr = weak alias void (), void ()* @__declfirstattr
// CHECK-DAG: @mix2 = weak alias void (), void ()* @__mix2
// CHECK-DAG: @a1 = weak alias void (), void ()* @__a1
// CHECK-DAG: @xxx = weak alias void (), void ()* @__xxx



Expand Down
2 changes: 1 addition & 1 deletion test/CodeGenCXX/attr.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -emit-llvm -o - %s | FileCheck %s

// CHECK: @test2 = alias i32 ()* @_Z5test1v
// CHECK: @test2 = alias i32 (), i32 ()* @_Z5test1v

// CHECK: define i32 @_Z3foov() [[NUW:#[0-9]+]] align 1024
int foo() __attribute__((aligned(1024)));
Expand Down
2 changes: 1 addition & 1 deletion test/CodeGenCXX/constructor-alias.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ struct B {
B::B() {
}

// CHECK: @_ZN1BC1Ev = alias void (%struct.B*)* @_ZN1BC2Ev
// CHECK: @_ZN1BC1Ev = alias void (%struct.B*), void (%struct.B*)* @_ZN1BC2Ev
2 changes: 1 addition & 1 deletion test/CodeGenCXX/ctor-dtor-alias.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace test1 {
// weak_odr constructors and destructors.

// CHECK1: @_ZN5test16foobarIvEC1Ev = weak_odr alias void {{.*}} @_ZN5test16foobarIvEC2Ev
// CHECK1: @_ZN5test16foobarIvED1Ev = weak_odr alias void (%"struct.test1::foobar"*)* @_ZN5test16foobarIvED2Ev
// CHECK1: @_ZN5test16foobarIvED1Ev = weak_odr alias void (%"struct.test1::foobar"*), void (%"struct.test1::foobar"*)* @_ZN5test16foobarIvED2Ev
// CHECK1: define weak_odr void @_ZN5test16foobarIvEC2Ev({{.*}} comdat($_ZN5test16foobarIvEC5Ev)
// CHECK1: define weak_odr void @_ZN5test16foobarIvED2Ev({{.*}} comdat($_ZN5test16foobarIvED5Ev)
// CHECK1: define weak_odr void @_ZN5test16foobarIvED0Ev({{.*}} comdat($_ZN5test16foobarIvED5Ev)
Expand Down
2 changes: 1 addition & 1 deletion test/CodeGenCXX/cxx11-thread-local-reference.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ int &f();
// CHECK: @r = thread_local global i32* null
thread_local int &r = f();

// CHECK: @_ZTH1r = alias void ()* @__tls_init
// CHECK: @_ZTH1r = alias void (), void ()* @__tls_init

int &g() { return r; }

Expand Down
8 changes: 4 additions & 4 deletions test/CodeGenCXX/cxx11-thread-local.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ int e = V<int>::m;

// CHECK: @llvm.global_ctors = appending global {{.*}} @[[GLOBAL_INIT:[^ ]*]]

// CHECK: @_ZTH1a = alias void ()* @__tls_init
// CHECK: @_ZTHL1d = internal alias void ()* @__tls_init
// CHECK: @_ZTHN1U1mE = alias void ()* @__tls_init
// CHECK: @_ZTHN1VIiE1mE = linkonce_odr alias void ()* @__tls_init
// CHECK: @_ZTH1a = alias void (), void ()* @__tls_init
// CHECK: @_ZTHL1d = internal alias void (), void ()* @__tls_init
// CHECK: @_ZTHN1U1mE = alias void (), void ()* @__tls_init
// CHECK: @_ZTHN1VIiE1mE = linkonce_odr alias void (), void ()* @__tls_init


// Individual variable initialization functions:
Expand Down
2 changes: 1 addition & 1 deletion test/CodeGenCXX/destructors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ namespace test1 {

struct S : A { ~S(); int x; };
S::~S() {}
// CHECK4: @_ZN5test11SD2Ev = alias bitcast {{.*}} @_ZN5test11AD2Ev
// CHECK4: @_ZN5test11SD2Ev = alias {{.*}}, bitcast {{.*}} @_ZN5test11AD2Ev

struct T : A { ~T(); B x; };
T::~T() {} // CHECK4-LABEL: define void @_ZN5test11TD2Ev(%"struct.test1::T"* %this) unnamed_addr
Expand Down
4 changes: 2 additions & 2 deletions test/CodeGenCXX/dllexport-alias.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ A::A() {}

A::~A() {}

// CHECK: @_ZN1AC1Ev = dllexport alias void (%class.A*)* @_ZN1AC2Ev
// CHECK: @_ZN1AD1Ev = dllexport alias void (%class.A*)* @_ZN1AD2Ev
// CHECK: @_ZN1AC1Ev = dllexport alias void (%class.A*), void (%class.A*)* @_ZN1AC2Ev
// CHECK: @_ZN1AD1Ev = dllexport alias void (%class.A*), void (%class.A*)* @_ZN1AD2Ev
2 changes: 1 addition & 1 deletion test/CodeGenCXX/dllexport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ void W::foo() {}
// M32-DAG: define weak_odr dllexport x86_thiscallcc %struct.W* @"\01??0W@@QAE@ABU0@@Z"
// vftable:
// M32-DAG: [[W_VTABLE:@.*]] = private unnamed_addr constant [2 x i8*] [i8* bitcast (%rtti.CompleteObjectLocator* @"\01??_R4W@@6B@" to i8*), i8* bitcast (void (%struct.W*)* @"\01?foo@W@@UAEXXZ" to i8*)], comdat($"\01??_7W@@6B@")
// M32-DAG: @"\01??_7W@@6B@" = dllexport unnamed_addr alias getelementptr inbounds ([2 x i8*], [2 x i8*]* [[W_VTABLE]], i32 0, i32 1)
// M32-DAG: @"\01??_7W@@6B@" = dllexport unnamed_addr alias i8*, getelementptr inbounds ([2 x i8*], [2 x i8*]* [[W_VTABLE]], i32 0, i32 1)
// G32-DAG: @_ZTV1W = dllexport unnamed_addr constant [3 x i8*] [i8* null, i8* bitcast ({ i8*, i8* }* @_ZTI1W to i8*), i8* bitcast (void (%struct.W*)* @_ZN1W3fooEv to i8*)]

struct __declspec(dllexport) X : public virtual W {};
Expand Down
4 changes: 2 additions & 2 deletions test/CodeGenCXX/extern-c.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ extern "C" {

// CHECK-NOT: @unused
// CHECK-NOT: @duplicate_internal
// CHECK: @internal_var = internal alias i32* @_Z12internal_var
// CHECK: @internal_var = internal alias i32, i32* @_Z12internal_var
// CHECK-NOT: @unused
// CHECK-NOT: @duplicate_internal
// CHECK: @internal_fn = internal alias i32 ()* @_Z11internal_fnv
// CHECK: @internal_fn = internal alias i32 (), i32 ()* @_Z11internal_fnv
// CHECK-NOT: @unused
// CHECK-NOT: @duplicate_internal
}
Expand Down
2 changes: 1 addition & 1 deletion test/CodeGenCXX/microsoft-abi-structors-alias.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ B::~B() {}
void foo() {
B b;
}
// CHECK-DAG: @"\01??1B@test2@@UAE@XZ" = alias bitcast (void (%"struct.test2::A"*)* @"\01??1A@test2@@UAE@XZ" to void (%"struct.test2::B"*)*)
// CHECK-DAG: @"\01??1B@test2@@UAE@XZ" = alias void (%"struct.test2::B"*), bitcast (void (%"struct.test2::A"*)* @"\01??1A@test2@@UAE@XZ" to void (%"struct.test2::B"*)*)
}
6 changes: 3 additions & 3 deletions test/CodeGenCXX/microsoft-abi-vftables.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ struct S {
} s;

// RTTI-DAG: [[VTABLE_S:@.*]] = private unnamed_addr constant [2 x i8*] [i8* bitcast ({{.*}} @"\01??_R4S@@6B@" to i8*), i8* bitcast ({{.*}} @"\01??_GS@@UAEPAXI@Z" to i8*)], comdat($"\01??_7S@@6B@")
// RTTI-DAG: @"\01??_7S@@6B@" = unnamed_addr alias getelementptr inbounds ([2 x i8*], [2 x i8*]* [[VTABLE_S]], i32 0, i32 1)
// RTTI-DAG: @"\01??_7S@@6B@" = unnamed_addr alias i8*, getelementptr inbounds ([2 x i8*], [2 x i8*]* [[VTABLE_S]], i32 0, i32 1)

// NO-RTTI-DAG: @"\01??_7S@@6B@" = linkonce_odr unnamed_addr constant [1 x i8*] [i8* bitcast ({{.*}} @"\01??_GS@@UAEPAXI@Z" to i8*)]

Expand All @@ -26,7 +26,7 @@ struct __declspec(dllexport) V {
} v;

// RTTI-DAG: [[VTABLE_V:@.*]] = private unnamed_addr constant [2 x i8*] [i8* bitcast ({{.*}} @"\01??_R4V@@6B@" to i8*), i8* bitcast ({{.*}} @"\01??_GV@@UAEPAXI@Z" to i8*)], comdat($"\01??_7V@@6B@")
// RTTI-DAG: @"\01??_7V@@6B@" = dllexport unnamed_addr alias getelementptr inbounds ([2 x i8*], [2 x i8*]* [[VTABLE_V]], i32 0, i32 1)
// RTTI-DAG: @"\01??_7V@@6B@" = dllexport unnamed_addr alias i8*, getelementptr inbounds ([2 x i8*], [2 x i8*]* [[VTABLE_V]], i32 0, i32 1)

// NO-RTTI-DAG: @"\01??_7V@@6B@" = weak_odr dllexport unnamed_addr constant [1 x i8*] [i8* bitcast ({{.*}} @"\01??_GV@@UAEPAXI@Z" to i8*)]

Expand All @@ -36,7 +36,7 @@ struct W {
} w;
}
// RTTI-DAG: [[VTABLE_W:@.*]] = private unnamed_addr constant [2 x i8*] [i8* bitcast ({{.*}} @"\01??_R4W@?A@@6B@" to i8*), i8* bitcast ({{.*}} @"\01??_GW@?A@@UAEPAXI@Z" to i8*)]
// RTTI-DAG: @"\01??_7W@?A@@6B@" = internal unnamed_addr alias getelementptr inbounds ([2 x i8*], [2 x i8*]* [[VTABLE_W]], i32 0, i32 1)
// RTTI-DAG: @"\01??_7W@?A@@6B@" = internal unnamed_addr alias i8*, getelementptr inbounds ([2 x i8*], [2 x i8*]* [[VTABLE_W]], i32 0, i32 1)

// NO-RTTI-DAG: @"\01??_7W@?A@@6B@" = internal unnamed_addr constant [1 x i8*] [i8* bitcast ({{.*}} @"\01??_GW@?A@@UAEPAXI@Z" to i8*)]

Expand Down
2 changes: 1 addition & 1 deletion test/CodeGenCXX/new-alias.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ using size_t = decltype(sizeof(0));
extern "C" char *something(long long x) {
}

// CHECK: @_Znwm = alias i8* (i64)* @something
// CHECK: @_Znwm = alias i8* (i64), i8* (i64)* @something
void *operator new(size_t) __attribute__((alias("something")));

// PR16715: don't assert here.
Expand Down
2 changes: 1 addition & 1 deletion test/CodeGenCXX/virtual-destructor-calls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ struct B : A {
// CHECK: @_ZN1BD1Ev = alias {{.*}} @_ZN1BD2Ev

// (aliases from C)
// CHECK: @_ZN1CD2Ev = alias bitcast {{.*}} @_ZN1BD2Ev
// CHECK: @_ZN1CD2Ev = alias {{.*}}, bitcast {{.*}} @_ZN1BD2Ev
// CHECK: @_ZN1CD1Ev = alias {{.*}} @_ZN1CD2Ev

// Base dtor: actually calls A's base dtor.
Expand Down
10 changes: 5 additions & 5 deletions test/OpenMP/threadprivate_codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,11 @@ struct S5 {
// CHECK-TLS-DAG: [[ST_S4_ST_GUARD:@_ZGVN2STI2S4E2stE]] = linkonce_odr thread_local global i64 0
// CHECK-TLS-DAG: @__tls_guard = internal thread_local global i8 0
// CHECK-TLS-DAG: @__dso_handle = external global i8
// CHECK-TLS-DAG: [[GS1_TLS_INIT:@_ZTHL3gs1]] = internal alias void ()* @__tls_init
// CHECK-TLS-DAG: [[ARR_X_TLS_INIT:@_ZTH5arr_x]] = alias void ()* @__tls_init
// CHECK-TLS-DAG: [[ST_INT_ST_TLS_INIT:@_ZTHN2STIiE2stE]] = linkonce_odr alias void ()* @__tls_init
// CHECK-TLS-DAG: [[ST_FLOAT_ST_TLS_INIT:@_ZTHN2STIfE2stE]] = linkonce_odr alias void ()* @__tls_init
// CHECK-TLS-DAG: [[ST_S4_ST_TLS_INIT:@_ZTHN2STI2S4E2stE]] = linkonce_odr alias void ()* @__tls_init
// CHECK-TLS-DAG: [[GS1_TLS_INIT:@_ZTHL3gs1]] = internal alias void (), void ()* @__tls_init
// CHECK-TLS-DAG: [[ARR_X_TLS_INIT:@_ZTH5arr_x]] = alias void (), void ()* @__tls_init
// CHECK-TLS-DAG: [[ST_INT_ST_TLS_INIT:@_ZTHN2STIiE2stE]] = linkonce_odr alias void (), void ()* @__tls_init
// CHECK-TLS-DAG: [[ST_FLOAT_ST_TLS_INIT:@_ZTHN2STIfE2stE]] = linkonce_odr alias void (), void ()* @__tls_init
// CHECK-TLS-DAG: [[ST_S4_ST_TLS_INIT:@_ZTHN2STI2S4E2stE]] = linkonce_odr alias void (), void ()* @__tls_init

struct Static {
static S3 s;
Expand Down

0 comments on commit c0de2d0

Please sign in to comment.