brintos

brintos / llvm-project-archived public Read only

0
0
Text · 987 B · 9f11912 Raw
32 lines · cpp
1// RUN: %clang_cc1 -triple powerpc-ibm-aix-xcoff -x c++ -emit-llvm \2// RUN:     -fno-use-cxa-atexit < %s |\3// RUN:   FileCheck %s4// RUN: %clang_cc1 -triple powerpc64-ibm-aix-xcoff -x c++ -emit-llvm \5// RUN:     -fno-use-cxa-atexit < %s | \6// RUN:   FileCheck %s7 8// CHECK: @llvm.global_ctors = appending global [4 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 65535, ptr @_Z4foo3v, ptr null }, { i32, ptr, ptr } { i32 180, ptr @_Z4foo2v, ptr null }, { i32, ptr, ptr } { i32 180, ptr @_Z3foov, ptr null }, { i32, ptr, ptr } { i32 65535, ptr @_GLOBAL__sub_I__, ptr null }]9// CHECK: @llvm.global_dtors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 65535, ptr @_GLOBAL__D_a, ptr null }]10 11int foo() __attribute__((constructor(180)));12int foo2() __attribute__((constructor(180)));13int foo3() __attribute__((constructor(65535)));14 15struct Test {16public:17  Test() {}18  ~Test() {}19} t;20 21int foo3() {22  return 3;23}24 25int foo2() {26  return 2;27}28 29int foo() {30  return 1;31}32