brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.9 KiB · ad5a3e1 Raw
66 lines · plain
1// https://github.com/llvm/llvm-project/issues/597652// FIXME: Since the signature of the constructors/destructors is3// different in different targets. The current CHECK can't work4// well when targeting AIX and z/OS.5// It would be better to add the corresponding test for other test.6// UNSUPPORTED: system-aix7// UNSUPPORTED: target={{.*}}-zos{{.*}}8//9// RUN: rm -rf %t10// RUN: mkdir %t11// RUN: split-file %s %t12//13// RUN: %clang_cc1 -std=c++20 %t/M.cppm -triple %itanium_abi_triple -emit-module-interface -o %t/M.pcm14// RUN: %clang_cc1 -std=c++20 %t/M.pcm -triple %itanium_abi_triple -emit-llvm -o - | FileCheck %t/M.cppm15// RUN: %clang_cc1 -std=c++20 %t/Use.cpp -fprebuilt-module-path=%t -triple %itanium_abi_triple -emit-llvm -o - | FileCheck %t/Use.cpp16//17// Check that the behavior of header units is normal as headers.18// RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple -xc++-user-header %t/foo.h -emit-header-unit -o %t/foo.pcm19// RUN: %clang_cc1 -std=c++20 %t/UseHU.cpp -fmodule-file=%t/foo.pcm -triple %itanium_abi_triple -emit-llvm -o - | FileCheck %t/UseHU.cpp20 21//--- M.cppm22export module M;23export class A {24public:25    A();26    ~A();27    void use();28};29export A a;30 31// CHECK: @_ZW1M1a = {{.*}}global %class.A zeroinitializer32// CHECK: define{{.*}}void @__cxx_global_var_init()33// CHECK-NEXT: entry:34// CHECK-NEXT: call{{.*}}@_ZNW1M1AC1Ev({{.*}}@_ZW1M1a35// CHECK-NEXT: call{{.*}}@__cxa_atexit(ptr @_ZNW1M1AD1Ev, ptr @_ZW1M1a36 37//--- Use.cpp38import M;39void use() {40    a.use();41}42 43// CHECK-NOT: @_ZNW1M1AC1Ev44// CHECK-NOT: @_ZNW1M1AD1Ev45 46//--- foo.h47class A {48public:49    A();50    ~A();51    void use();52};53A a;54 55//--- UseHU.cpp56import "foo.h";57void use() {58    a.use();59}60 61// CHECK: @a = {{.*}}global %class.A zeroinitializer62// CHECK: define{{.*}}void @__cxx_global_var_init()63// CHECK-NEXT: entry:64// CHECK-NEXT: call{{.*}}@_ZN1AC1Ev({{.*}}@a65// CHECK-NEXT: call{{.*}}@__cxa_atexit(ptr @_ZN1AD1Ev, ptr @a66