2010-12-02 10:13:27 +08:00
|
|
|
// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s -check-prefix=CHECK-DEFAULT
|
2020-03-10 03:25:24 +08:00
|
|
|
// RUN: %clang_cc1 %s -fno-common -emit-llvm -o - | FileCheck %s -check-prefix=CHECK-DEFAULT
|
|
|
|
// RUN: %clang_cc1 %s -fcommon -emit-llvm -o - | FileCheck %s -check-prefix=CHECK-COMMON
|
2009-03-27 00:37:00 +08:00
|
|
|
|
2020-03-10 03:25:24 +08:00
|
|
|
// CHECK-COMMON: @x = common {{(dso_local )?}}global
|
|
|
|
// CHECK-DEFAULT: @x = {{(dso_local )?}}global
|
2009-03-27 00:37:00 +08:00
|
|
|
int x;
|
2010-12-02 10:45:55 +08:00
|
|
|
|
2020-03-10 03:25:24 +08:00
|
|
|
// CHECK-COMMON: @ABC = {{(dso_local )?}}global
|
2018-02-24 03:30:48 +08:00
|
|
|
// CHECK-DEFAULT: @ABC = {{(dso_local )?}}global
|
2010-12-02 10:45:55 +08:00
|
|
|
typedef void* (*fn_t)(long a, long b, char *f, int c);
|
|
|
|
fn_t ABC __attribute__ ((nocommon));
|
|
|
|
|
2020-03-10 03:25:24 +08:00
|
|
|
// CHECK-COMMON: @y = common {{(dso_local )?}}global
|
2018-02-24 03:30:48 +08:00
|
|
|
// CHECK-DEFAULT: @y = common {{(dso_local )?}}global
|
2012-07-10 02:34:21 +08:00
|
|
|
int y __attribute__((common));
|