Eric Christopher | 7c92342 | 2010-12-02 02:13:27 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s -check-prefix=CHECK-DEFAULT |
| 2 | // RUN: %clang_cc1 %s -fno-common -emit-llvm -o - | FileCheck %s -check-prefix=CHECK-NOCOMMON |
Daniel Dunbar | 069afd5 | 2009-03-26 16:37:00 +0000 | [diff] [blame] | 3 | |
Eric Christopher | 7c92342 | 2010-12-02 02:13:27 +0000 | [diff] [blame] | 4 | // CHECK-DEFAULT: @x = common global |
| 5 | // CHECK-NOCOMMON: @x = global |
Daniel Dunbar | 069afd5 | 2009-03-26 16:37:00 +0000 | [diff] [blame] | 6 | int x; |
Eric Christopher | a6cf1e7 | 2010-12-02 02:45:55 +0000 | [diff] [blame] | 7 | |
| 8 | // CHECK-DEFAULT: @ABC = global |
| 9 | // CHECK-NOCOMMON: @ABC = global |
| 10 | typedef void* (*fn_t)(long a, long b, char *f, int c); |
| 11 | fn_t ABC __attribute__ ((nocommon)); |
| 12 | |
| 13 | // CHECK-DEFAULT: @y = common global |
| 14 | // CHECK-NOCOMMON: @y = common global |
| 15 | int y __attribute__((common)); |