Anders Carlsson | 173d512 | 2011-04-27 04:37:08 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -emit-llvm -triple=x86_64-apple-darwin10 -o - %s | FileCheck -check-prefix=WITH-TSS %s |
| 2 | // RUN: %clang_cc1 -emit-llvm -triple=x86_64-apple-darwin10 -o - %s -fno-threadsafe-statics | FileCheck -check-prefix=NO-TSS %s |
Anders Carlsson | a508b7d | 2010-02-06 23:23:06 +0000 | [diff] [blame] | 3 | |
| 4 | int f(); |
| 5 | |
Anders Carlsson | 173d512 | 2011-04-27 04:37:08 +0000 | [diff] [blame] | 6 | // WITH-TSS: @_ZZ1gvE1a = internal global i32 0, align 4 |
| 7 | // WITH-TSS: @_ZGVZ1gvE1a = internal global i64 0 |
| 8 | |
Bill Wendling | f7a9da0 | 2013-02-20 07:22:19 +0000 | [diff] [blame^] | 9 | // WITH-TSS: define void @_Z1gv() #0 |
Anders Carlsson | a508b7d | 2010-02-06 23:23:06 +0000 | [diff] [blame] | 10 | // WITH-TSS: call i32 @__cxa_guard_acquire |
| 11 | // WITH-TSS: call void @__cxa_guard_release |
| 12 | // WITH-TSS: ret void |
| 13 | void g() { |
| 14 | static int a = f(); |
| 15 | } |
| 16 | |
Anders Carlsson | 173d512 | 2011-04-27 04:37:08 +0000 | [diff] [blame] | 17 | // NO-TSS: @_ZZ1gvE1a = internal global i32 0, align 4 |
| 18 | // NO-TSS: @_ZGVZ1gvE1a = internal global i8 0 |
| 19 | |
Bill Wendling | f7a9da0 | 2013-02-20 07:22:19 +0000 | [diff] [blame^] | 20 | // NO-TSS: define void @_Z1gv() #0 |
Anders Carlsson | a508b7d | 2010-02-06 23:23:06 +0000 | [diff] [blame] | 21 | // NO-TSS-NOT: call i32 @__cxa_guard_acquire |
| 22 | // NO-TSS-NOT: call void @__cxa_guard_release |
| 23 | // NO-TSS: ret void |
Bill Wendling | f7a9da0 | 2013-02-20 07:22:19 +0000 | [diff] [blame^] | 24 | |
| 25 | // WITH-TSS: attributes #0 = { nounwind "target-features"={{.*}} } |
| 26 | // WITH-TSS: attributes #1 = { nounwind } |
| 27 | // WITH-TSS: attributes #2 = { "target-features"={{.*}} } |
| 28 | |
| 29 | // NO-TSS: attributes #0 = { nounwind "target-features"={{.*}} } |
| 30 | // NO-TSS: attributes #1 = { "target-features"={{.*}} } |