Mercurial > hg > CbC > CbC_llvm
diff clang/test/CodeGen/alias.c @ 207:2e18cbf3894f
LLVM12
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 08 Jun 2021 06:07:14 +0900 |
parents | 0572611fdcc8 |
children | c4bab56944e8 |
line wrap: on
line diff
--- a/clang/test/CodeGen/alias.c Mon May 25 11:55:54 2020 +0900 +++ b/clang/test/CodeGen/alias.c Tue Jun 08 06:07:14 2021 +0900 @@ -5,7 +5,7 @@ // RUN: %clang_cc1 -triple aarch64-linux-gnu -emit-llvm -o - %s | FileCheck -check-prefix=CHECKGLOBALS %s int g0; -// CHECKBASIC-DAG: @g0 = global i32 0 +// CHECKBASIC-DAG: @g0 ={{.*}} global i32 0 // CHECKASM-DAG: .bss // CHECKASM-DAG: .globl g0 // CHECKASM-DAG: .p2align 2 @@ -13,7 +13,7 @@ // CHECKASM-DAG: .long 0 // CHECKASM-DAG: .size g0, 4 __thread int TL_WITH_ALIAS; -// CHECKBASIC-DAG: @TL_WITH_ALIAS = thread_local global i32 0, align 4 +// CHECKBASIC-DAG: @TL_WITH_ALIAS ={{.*}} thread_local global i32 0, align 4 // CHECKASM-DAG: .globl TL_WITH_ALIAS // CHECKASM-DAG: .size TL_WITH_ALIAS, 4 static int bar1 = 42; @@ -23,24 +23,24 @@ // PR24379: alias variable expected to have same size as aliasee even when types differ const int wacom_usb_ids[] = {1, 1, 2, 3, 5, 8, 13, 0}; -// CHECKBASIC-DAG: @wacom_usb_ids = constant [8 x i32] [i32 1, i32 1, i32 2, i32 3, i32 5, i32 8, i32 13, i32 0], align 4 +// CHECKBASIC-DAG: @wacom_usb_ids ={{.*}} constant [8 x i32] [i32 1, i32 1, i32 2, i32 3, i32 5, i32 8, i32 13, i32 0], align 4 // 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 i32, 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: .set __mod_usb_device_table, wacom_usb_ids // CHECKASM-NOT: .size __mod_usb_device_table extern int g1; extern int g1 __attribute((alias("g0"))); -// CHECKBASIC-DAG: @g1 = alias i32, i32* @g0 +// CHECKBASIC-DAG: @g1 ={{.*}} alias i32, i32* @g0 // CHECKASM-DAG: .globl g1 // CHECKASM-DAG: .set g1, g0 // CHECKASM-NOT: .size g1 extern __thread int __libc_errno __attribute__ ((alias ("TL_WITH_ALIAS"))); -// CHECKBASIC-DAG: @__libc_errno = thread_local alias i32, i32* @TL_WITH_ALIAS +// CHECKBASIC-DAG: @__libc_errno ={{.*}} thread_local alias i32, i32* @TL_WITH_ALIAS // CHECKASM-DAG: .globl __libc_errno // CHECKASM-DAG: .set __libc_errno, TL_WITH_ALIAS // CHECKASM-NOT: .size __libc_errno @@ -48,11 +48,11 @@ void f0(void) { } extern void f1(void); extern void f1(void) __attribute((alias("f0"))); -// 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]+]] { +// 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. // PR3200 @@ -71,15 +71,15 @@ 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), 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); } -// CHECKCC: define arm_aapcs_vfpcc i32 @outer(i32 %a) [[NUW]] { +// CHECKCC: define{{.*}} arm_aapcs_vfpcc i32 @outer(i32 %a) [[NUW]] { // CHECKCC: call arm_aapcs_vfpcc i32 @inner(i32 %{{.*}}) int outer_weak(int a) { return inner_weak_a(a); } -// CHECKCC: define arm_aapcs_vfpcc i32 @outer_weak(i32 %a) [[NUW]] { +// CHECKCC: define{{.*}} arm_aapcs_vfpcc i32 @outer_weak(i32 %a) [[NUW]] { // CHECKCC: call arm_aapcs_vfpcc i32 @inner_weak(i32 %{{.*}}) // CHECKCC: define internal arm_aapcs_vfpcc i32 @inner_weak(i32 %a) [[NUW]] { @@ -106,6 +106,12 @@ static void test11_foo(void) __attribute__((alias("test11"))); // Test that gnu_inline+alias work. -// CHECKGLOBALS: @test12_alias = alias void (), void ()* @test12 +// CHECKGLOBALS: @test12_alias ={{.*}} alias void (), void ()* @test12 void test12(void) {} inline void test12_alias(void) __attribute__((gnu_inline, alias("test12"))); + +// Test that a non visible (-Wvisibility) type doesn't assert. +// CHECKGLOBALS: @test13_alias ={{.*}} alias {}, bitcast (void (i32)* @test13 to {}*) +enum a_type { test13_a }; +void test13(enum a_type y) {} +void test13_alias(enum undeclared_type y) __attribute__((alias ("test13")));