Hans Wennborg | 442e4f7 | 2013-12-13 22:43:52 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -cxx-abi itanium -emit-llvm -o - %s | FileCheck %s |
Eli Friedman | 8a5f75e | 2009-11-26 02:52:12 +0000 | [diff] [blame] | 2 | |
| 3 | const int x = 10; |
| 4 | const int y = 20; |
Richard Smith | dc0ef45 | 2012-10-19 06:37:48 +0000 | [diff] [blame] | 5 | const volatile int z = 30; |
Eli Friedman | 8a5f75e | 2009-11-26 02:52:12 +0000 | [diff] [blame] | 6 | // CHECK-NOT: @x |
Richard Smith | dc0ef45 | 2012-10-19 06:37:48 +0000 | [diff] [blame] | 7 | // CHECK: @z = constant i32 30 |
Alexis Hunt | aecc45c | 2010-01-24 03:04:27 +0000 | [diff] [blame] | 8 | // CHECK: @_ZL1y = internal constant i32 20 |
Eli Friedman | 8a5f75e | 2009-11-26 02:52:12 +0000 | [diff] [blame] | 9 | const int& b() { return y; } |
| 10 | |
Eli Friedman | f873c2f | 2009-11-26 03:04:01 +0000 | [diff] [blame] | 11 | const char z1[] = "asdf"; |
| 12 | const char z2[] = "zxcv"; |
Richard Smith | dc0ef45 | 2012-10-19 06:37:48 +0000 | [diff] [blame] | 13 | const volatile char z3[] = "zxcv"; |
Eli Friedman | f873c2f | 2009-11-26 03:04:01 +0000 | [diff] [blame] | 14 | // CHECK-NOT: @z1 |
Richard Smith | dc0ef45 | 2012-10-19 06:37:48 +0000 | [diff] [blame] | 15 | // CHECK: @z3 = constant |
Alexis Hunt | aecc45c | 2010-01-24 03:04:27 +0000 | [diff] [blame] | 16 | // CHECK: @_ZL2z2 = internal constant |
Eli Friedman | f873c2f | 2009-11-26 03:04:01 +0000 | [diff] [blame] | 17 | const char* b2() { return z2; } |