Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s |
Eli Friedman | bd94ab9 | 2009-11-26 02:52:12 +0000 | [diff] [blame] | 2 | |
| 3 | const int x = 10; |
| 4 | const int y = 20; |
Richard Smith | 820e9a7 | 2012-10-19 06:37:48 +0000 | [diff] [blame] | 5 | const volatile int z = 30; |
Eli Friedman | bd94ab9 | 2009-11-26 02:52:12 +0000 | [diff] [blame] | 6 | // CHECK-NOT: @x |
Richard Smith | 820e9a7 | 2012-10-19 06:37:48 +0000 | [diff] [blame] | 7 | // CHECK: @z = constant i32 30 |
Sean Hunt | 3145525 | 2010-01-24 03:04:27 +0000 | [diff] [blame] | 8 | // CHECK: @_ZL1y = internal constant i32 20 |
Eli Friedman | bd94ab9 | 2009-11-26 02:52:12 +0000 | [diff] [blame] | 9 | const int& b() { return y; } |
| 10 | |
Eli Friedman | e9d6554 | 2009-11-26 03:04:01 +0000 | [diff] [blame] | 11 | const char z1[] = "asdf"; |
| 12 | const char z2[] = "zxcv"; |
Richard Smith | 820e9a7 | 2012-10-19 06:37:48 +0000 | [diff] [blame] | 13 | const volatile char z3[] = "zxcv"; |
Eli Friedman | e9d6554 | 2009-11-26 03:04:01 +0000 | [diff] [blame] | 14 | // CHECK-NOT: @z1 |
Richard Smith | 820e9a7 | 2012-10-19 06:37:48 +0000 | [diff] [blame] | 15 | // CHECK: @z3 = constant |
Sean Hunt | 3145525 | 2010-01-24 03:04:27 +0000 | [diff] [blame] | 16 | // CHECK: @_ZL2z2 = internal constant |
Eli Friedman | e9d6554 | 2009-11-26 03:04:01 +0000 | [diff] [blame] | 17 | const char* b2() { return z2; } |