; RUN: llvm-spirv -to-binary %s -o %t.spv
; RUN: spirv-val %t.spv
; RUN: llvm-spirv -r %t.spv -o %t.rev.bc
; RUN: llvm-dis %t.rev.bc -o %t.rev.ll
; RUN: FileCheck < %t.rev.ll %s -check-prefix=CHECK-LLVM

; CHECK-LLVM: %[[#Var:]] = load i32, ptr addrspace(1) @_ZN5Outer5Inner6globalE, align 4, !dbg ![[#LineLoc:]]
; CHECK-LLVM: %inc = add nsw i32 %[[#Var]], 1, !dbg ![[#DebugLineLoc:]]
; CHECK-LLVM: ![[#LineLoc]] = !DILocation(line: 357, column: 113, scope: ![[#Scope:]])
; CHECK-LLVM: ![[#DebugLineLoc]] = !DILocation(line: 8, column: 16, scope: ![[#Scope]])

119734787 66560 393230 138 0 
2 Capability Addresses 
2 Capability Linkage 
2 Capability Kernel 
8 Extension "SPV_KHR_non_semantic_info" 
5 ExtInstImport 1 "OpenCL.std" 
11 ExtInstImport 2 "NonSemantic.Shader.DebugInfo.200" 
3 MemoryModel 2 2 
10 String 14 "/path/to/inlined-namespace.cxx" 
3 String 16 "0" 
3 String 18 "" 
4 String 23 "clang" 
3 String 25 "int" 
3 String 30 "foo" 
4 String 31 "_Z3foov" 
4 String 37 "Outer" 
4 String 41 "Inner" 
4 String 44 "global" 
8 String 45 "_ZN5Outer5Inner6globalE" 
3 Source 0 0 
8 Name 6 "_ZN5Outer5Inner6globalE" 
4 Name 9 "_Z3foov" 
4 Name 10 "entry" 
3 Name 13 "inc" 
10 Decorate 6 LinkageAttributes "_ZN5Outer5Inner6globalE" Export 
4 Decorate 6 Alignment 4 
6 Decorate 9 LinkageAttributes "_Z3foov" Export 
3 Decorate 13 NoSignedWrap 
4 TypeInt 3 32 0 
4 Constant 3 5 0 
4 Constant 3 12 1 
4 Constant 3 20 65536 
4 Constant 3 21 4 
4 Constant 3 22 217 
4 Constant 3 26 32 
4 Constant 3 32 7 
4 Constant 3 33 136 
4 Constant 3 46 3 
4 Constant 3 47 8 
4 Constant 3 50 16 
4 Constant 3 52 9 
4 TypePointer 4 5 3 
2 TypeVoid 7 
3 TypeFunction 8 7 
2 TypeBool 38 
5 Variable 4 6 5 5 
3 ConstantTrue 38 39 
3 ConstantFalse 38 42 

6 ExtInst 7 15 2 DebugSource 14 
7 ExtInst 7 17 2 DebugBuildIdentifier 16 12 
6 ExtInst 7 19 2 DebugStoragePath 18 
10 ExtInst 7 24 2 DebugCompilationUnit 20 21 15 22 23 
8 ExtInst 7 27 2 DebugTypeBasic 25 26 21 
5 ExtInst 7 28 2 DebugInfoNone 
7 ExtInst 7 29 2 DebugTypeFunction 5 28 
15 ExtInst 7 34 2 DebugFunction 30 29 15 32 5 24 31 33 32 28 
6 ExtInst 7 36 2 DebugSource 18 
11 ExtInst 7 40 2 DebugLexicalBlock 36 5 5 24 37 39 
11 ExtInst 7 43 2 DebugLexicalBlock 36 5 5 40 41 42 
14 ExtInst 7 48 2 DebugGlobalVariable 44 27 15 46 5 43 45 6 47 

5 Function 7 9 2 8 

2 Label 10 
7 ExtInst 7 35 2 DebugFunctionDefinition 34 9
6 ExtInst 7 49 2 DebugScope 34
4 Line 14 357 113
6 Load 3 11 6 2 4
10 ExtInst 7 51 2 DebugLine 14 47 47 50 33
5 IAdd 3 13 11 12
5 ExtInst 7 511 2 DebugNoLine
5 ISub 3 137 11 12
1 NoLine
5 Store 6 13 2 4 
1 Return 

1 FunctionEnd 

